]> arthur.barton.de Git - bup.git/commitdiff
tests: web: also add some invalid UTF-8
authorJohannes Berg <johannes@sipsolutions.net>
Sun, 17 May 2020 19:43:45 +0000 (21:43 +0200)
committerRob Browning <rlb@defaultvalue.org>
Sun, 21 Jun 2020 16:20:58 +0000 (11:20 -0500)
The '¡excitement!' really tests only valid UTF-8 since it
comes from the original bash file, add another test that
explicitly creates a byte sequence that is invalid utf-8
and ensures that this is preserved properly as well.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
t/test-web.sh

index 1b34b8a947baa179fcdba1cab51a91b456058e3e..332ee0dbf17c7328bac6ada869401ca5bdb19ee7 100755 (executable)
@@ -49,6 +49,7 @@ WVSTART 'web'
 WVPASS bup init
 WVPASS mkdir src
 WVPASS echo '¡excitement!' > src/data
+WVPASS echo -e 'whee \x80\x90\xff' > "$(echo -ne 'src/whee \x80\x90\xff')"
 WVPASS bup index src
 WVPASS bup save -n '¡excitement!' --strip src
 
@@ -58,10 +59,13 @@ wait-for-server-start
 
 WVPASS curl --unix-socket ./socket \
        'http://localhost/%C2%A1excitement%21/latest/data' > result
+WVPASS curl --unix-socket ./socket \
+       'http://localhost/%C2%A1excitement%21/latest/whee%20%80%90%ff' > result2
 WVPASSEQ "$(curl --unix-socket ./socket http://localhost/static/styles.css)" \
          "$(cat "$TOP/lib/web/static/styles.css")"
 
 WVPASSEQ '¡excitement!' "$(cat result)"
+WVPASS cmp "$(echo -ne 'src/whee \x80\x90\xff')" result2
 WVPASS kill -s TERM "$web_pid"
 WVPASS wait "$web_pid"