Page MenuHomeFreeBSD

D38605.id117287.diff
No OneTemporary

D38605.id117287.diff

diff --git a/usr.bin/wc/tests/wc_test.sh b/usr.bin/wc/tests/wc_test.sh
--- a/usr.bin/wc/tests/wc_test.sh
+++ b/usr.bin/wc/tests/wc_test.sh
@@ -136,6 +136,32 @@
atf_check_wc foo $((tvl*c)) $((tvw*c)) $((tvc*c)) $((tvm*c))
}
+atf_test_case nul
+nul_head()
+{
+ atf_set "descr" "Input containing NUL"
+}
+nul_body()
+{
+ printf "a\0b\n" >foo
+ atf_check_wc foo 1 1 4
+}
+
+atf_test_case poop
+poop_head()
+{
+ atf_set "descr" "Multibyte sequence across buffer boundary"
+}
+poop_body()
+{
+ local c=0
+ while [ $((c*80)) -lt 65536 ] ; do
+ printf "💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩\n"
+ c=$((c+1))
+ done >foo
+ atf_check_wc foo $c $c $((c*80)) $((c*32))
+}
+
atf_test_case total
total_head()
{
@@ -190,6 +216,8 @@
atf_add_test_case invalid
atf_add_test_case multiline
atf_add_test_case multiline_repeated
+ atf_add_test_case nul
+ atf_add_test_case poop
atf_add_test_case total
atf_add_test_case unterminated
atf_add_test_case usage

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 9, 9:47 AM (13 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28565376
Default Alt Text
D38605.id117287.diff (1000 B)

Event Timeline