usleep tests: Avoid failure due to known Cygwin 3.5.3 bug.
[gnulib.git] / tests / test-readtokens.sh
blobd0af2590a67f7c8a097590d96e5c3795d4e0ae04
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ .
4 fail=0
6 ${CHECKER} test-readtokens || fail=1
8 # Simplest case.
9 echo a:b:c: > exp || fail=1
10 printf a:b:c | ${CHECKER} test-readtokens : > tmp 2>&1 || fail=1
11 LC_ALL=C tr -d '\r' < tmp > out || fail=1
12 compare exp out || fail=1
14 # Use NUL as the delimiter.
15 echo a:b:c: > exp || fail=1
16 printf 'a\0b\0c' | ${CHECKER} test-readtokens '\0' > tmp 2>&1 || fail=1
17 LC_ALL=C tr -d '\r' < tmp > out || fail=1
18 compare exp out || fail=1
20 # Two delimiter bytes, and adjacent delimiters in the input.
21 echo a:b:c: > exp || fail=1
22 printf a:-:b-:c:: | ${CHECKER} test-readtokens :- > tmp 2>&1 || fail=1
23 LC_ALL=C tr -d '\r' < tmp > out || fail=1
24 compare exp out || fail=1
26 Exit $fail