Skip to content

Commit

Permalink
Add a test for invalid unicode urls
Browse files Browse the repository at this point in the history
Add a simple regression test for the previous patch, that is, a test to
confirm that unicode urls are handled as if they were valid.
  • Loading branch information
eafer committed Sep 5, 2021
1 parent 641b396 commit 18ffe3c
Show file tree
Hide file tree
Showing 3 changed files with 1,211 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/check
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ diff "$OUT_OLD" "$OUT_NEW" || fail "Regular output differs for rust test"
echo '<html></html>' | $RDRVIEW &>/dev/null
[ "$?" -eq "139" ] && fail "Childless root node triggered a segfault"

# Check that unicode characters in the base url are accepted, even if invalid
RDRVIEW="../rdrview"
if [ "$1" = "-V" ]; then
RDRVIEW="$VALGRIND $RDRVIEW --disable-sandbox"
fi
$RDRVIEW -u 'https://ja.wikipedia.org/wiki/ウィキペディア' -H < "./unicode-url/source.html" > "$HTML_NEW" || fail "Failure on unicode url test"
diff "./unicode-url/expected.html" "$HTML_NEW" || fail "Unicode url not handled properly"

# Check that the only temporary files remaining belong to Valgrind
TMPCOUNT=$(ls -1 "$TMPDIR" | wc -l)
VGDCOUNT=$(ls -1 "$TMPDIR" | grep "vgdb-pipe" | wc -l)
Expand Down
3 changes: 3 additions & 0 deletions tests/unicode-url/expected.html

Large diffs are not rendered by default.

Loading

0 comments on commit 18ffe3c

Please sign in to comment.