diff --git a/contrib/netbsd-tests/usr.bin/sort/t_sort.sh b/contrib/netbsd-tests/usr.bin/sort/t_sort.sh --- a/contrib/netbsd-tests/usr.bin/sort/t_sort.sh +++ b/contrib/netbsd-tests/usr.bin/sort/t_sort.sh @@ -57,9 +57,9 @@ empty_file_body() { touch empty - atf_check -o empty sort -S empty - atf_check sort -S -c empty - atf_check sort -S -c -u empty + atf_check -o empty sort empty + atf_check sort -c empty + atf_check sort -c -u empty } atf_test_case end_of_options @@ -70,8 +70,8 @@ end_of_options_body() { echo x >-k - atf_check -o file:-k -x "sort -S -- -k in - atf_check -o inline:'\0a\n\0b\n' sort -S in + atf_check -o inline:'\0a\n\0b\n' sort in } atf_test_case long_records @@ -126,7 +126,7 @@ long_file_body() { awk 'BEGIN { for(i=0; i<20000; i++) print rand() }' >in - sort -S -r in | awk '$0 "x" != x { print ; x = $0 "x" }' >out + sort -r in | awk '$0 "x" != x { print ; x = $0 "x" }' >out atf_check -o file:out sort -u -r in } @@ -160,8 +160,13 @@ a EOF - atf_check -o file:in sort -b in - atf_check -o file:in -x "sort -b expout <xx" + atf_check -x "sort -k2b -k2 in >xx" atf_check -e ignore sort -c -t: -k2n xx - atf_check -x "sort -S -k2,2.1b -k2 in >xx" + atf_check -x "sort -k2,2.1b -k2 in >xx" atf_check -e ignore sort -c -t: -k3n xx - atf_check -x "sort -S -k2.3 -k2 in >xx" + atf_check -x "sort -k2.3 -k2 in >xx" atf_check -e ignore sort -c -t: -k4n xx - atf_check -x "sort -S -k2b,2.3 -k2 in >xx" + atf_check -x "sort -k2b,2.3 -k2 in >xx" atf_check -e ignore sort -c -t: -k5n xx - atf_check -x "sort -S -k2.3,2.1b -k2 in >xx" + atf_check -x "sort -k2.3,2.1b -k2 in >xx" atf_check -e ignore sort -c -t: -k6n xx - atf_check -x "sort -S -k2,2.1b -k2r in >xx" + atf_check -x "sort -k2,2.1b -k2r in >xx" atf_check -e ignore sort -c -t: -k7n xx - atf_check -x "sort -S -b -k2,2 -k2 in >xx" + atf_check -x "sort -b -k2,2 -k2 in >xx" atf_check -e ignore sort -c -t: -k8n xx # XXX This test is broken. The standard is not clear on the behavior. @@ -442,7 +447,7 @@ ca EOF - atf_check -o file:out sort -S -m in1 in2 + atf_check -o file:out sort -m in1 in2 } atf_test_case mflag_uflag @@ -585,7 +590,7 @@ } oflag_displaced_body() { - atf_check sort -S /dev/null -o out + atf_check sort /dev/null -o out test -f out || atf_fail "File not created" } @@ -757,7 +762,7 @@ b c EOF - atf_check -o file:out sort -S -k2 in + atf_check -o file:out sort -k2 in cat >out <./+0 + atf_expect_fail "Bug 255798" atf_check -o file:+0 sort -- +0 } @@ -892,20 +898,22 @@ atf_check -o file:in sort +1 -0.3 +1.4 -1.5 in } -atf_test_case plus_as_path -plus_as_path_head() -{ - atf_set "descr" "Tests +- addressing: 'file +0' raised a '-k1.1: No" \ - "such file or directory' error" -} -plus_as_path_body() -{ - echo 'good contents' >./+0 - echo 'more contents' >in - cat ./+0 in >expout - - atf_check -o file:expout sort in +0 -} +# Unclear if +0 is a valid position. +# +#atf_test_case plus_as_path +#plus_as_path_head() +#{ +# atf_set "descr" "Tests +- addressing: 'file +0' raised a '-k1.1: No" \ +# "such file or directory' error" +#} +#plus_as_path_body() +#{ +# echo 'good contents' >./+0 +# echo 'more contents' >in +# cat ./+0 in >expout +# +# atf_check -o file:expout sort in +0 +#} atf_test_case plus_bad_tempfile plus_bad_tempfile_head() @@ -919,23 +927,25 @@ atf_check -o file:in sort -T /tmp +0 in } -atf_test_case plus_rflag_invalid -plus_rflag_invalid_head() -{ - atf_set "descr" "Tests +- addressing: invalid record delimiter" -} -plus_rflag_invalid_body() -{ - ( - echo 'z b m f' - echo 'y c o e' - echo 'x a n h' - echo 'x a n g' - ) | tr '\n' '+' >in - - atf_check -o inline:'x a n g+x a n h+z b m f+y c o e+' \ - sort -R + -k2 in -} +# Record separator option is not available. +# +#atf_test_case plus_rflag_invalid +#plus_rflag_invalid_head() +#{ +# atf_set "descr" "Tests +- addressing: invalid record delimiter" +#} +#plus_rflag_invalid_body() +#{ +# ( +# echo 'z b m f' +# echo 'y c o e' +# echo 'x a n h' +# echo 'x a n g' +# ) | tr '\n' '+' >in +# +# atf_check -o inline:'x a n g+x a n h+z b m f+y c o e+' \ +# sort -R + -k2 in +#} atf_test_case plus_tflag plus_tflag_head() @@ -1015,9 +1025,9 @@ atf_add_test_case plus_one_minus_two atf_add_test_case plus_zero atf_add_test_case plus_nonmonotone - atf_add_test_case plus_as_path +# atf_add_test_case plus_as_path atf_add_test_case plus_bad_tempfile - atf_add_test_case plus_rflag_invalid +# atf_add_test_case plus_rflag_invalid atf_add_test_case plus_tflag atf_add_test_case plus_no_end }