Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/sed/tests/sed2_test.sh
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | commands_on_stdin_body() | ||||
printf "s/c/d/\n" > ./- | printf "s/c/d/\n" > ./- | ||||
atf_check -o 'inline:d\n' sed -f a_to_b -f - -f ./- a < b_to_c | atf_check -o 'inline:d\n' sed -f a_to_b -f - -f ./- a < b_to_c | ||||
# Verify that nothing is printed if there are no input files provided. | # Verify that nothing is printed if there are no input files provided. | ||||
printf 'i\\\nx' > insert_x | printf 'i\\\nx' > insert_x | ||||
atf_check -o 'empty' sed -f - < insert_x | atf_check -o 'empty' sed -f - < insert_x | ||||
} | } | ||||
atf_test_case bracket_y | |||||
bracket_y_head() | |||||
{ | |||||
atf_set "descr" "Verify '[' is ordinary character for 'y' command" | |||||
} | |||||
bracket_y_body() | |||||
{ | |||||
atf_check -e empty -o ignore echo | sed 'y/[/x/' | |||||
atf_check -e empty -o ignore echo | sed 'y/[]/xy/' | |||||
atf_check -e empty -o ignore echo | sed 'y/[a]/xyz/' | |||||
atf_check -e empty -o "inline:zyx" echo '][a' | sed 'y/[a]/xyz/' | |||||
atf_check -e empty -o "inline:bracket\n" echo 'bra[ke]' | sed 'y/[]/ct/' | |||||
atf_check -e empty -o "inline:bracket\n" \ | |||||
echo 'bra[ke]' | sed 'y[\[][ct[' | |||||
} | |||||
atf_init_test_cases() | atf_init_test_cases() | ||||
{ | { | ||||
atf_add_test_case inplace_command_q | atf_add_test_case inplace_command_q | ||||
atf_add_test_case inplace_hardlink_src | atf_add_test_case inplace_hardlink_src | ||||
atf_add_test_case inplace_symlink_src | atf_add_test_case inplace_symlink_src | ||||
atf_add_test_case escape_subst | atf_add_test_case escape_subst | ||||
atf_add_test_case commands_on_stdin | atf_add_test_case commands_on_stdin | ||||
atf_add_test_case hex_subst | atf_add_test_case hex_subst | ||||
atf_add_test_case bracket_y | |||||
} | } |