Skip to content

Commit 0536666

Browse files
committed
test(serverHandler): add case for check rendering special char
1 parent 9ff758c commit 0536666

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
source "$root"/lib.bash
4+
5+
"$ghfs" -l 3003 -r "$fs"/vhost1 &
6+
sleep 0.05 # wait server ready
7+
8+
(curl_get_body http://127.0.0.1:3003/special-char/ | grep -q -G '>first<em>\\n</em>second/</') ||
9+
fail 'first\\nsecond filename not displayed correctly'
10+
11+
(curl_get_body http://127.0.0.1:3003/special-char/ | grep -q -G '>important<em>\\t</em>notice.txt<') ||
12+
fail 'important\\tnotice.txt filename not displayed correctly'
13+
14+
notice=$(curl_get_body http://127.0.0.1:3003/special-char/important%09notice.txt)
15+
assert "$notice" 'vhost1/special-char/important\tnotice.txt'
16+
17+
kill %1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vhost1/special-char/first\nsecond/index.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vhost1/special-char/important\tnotice.txt

0 commit comments

Comments
 (0)