xref: /freebsd/usr.bin/bintrans/tests/bintrans_test.sh (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1atf_test_case encode_qp
2encode_qp_body()
3{
4	atf_check -e empty -o file:"$(atf_get_srcdir)/textqpenc" bintrans qp $(atf_get_srcdir)/textqpdec
5}
6
7atf_test_case decode_qp
8decode_qp_body()
9{
10	printf "=" > test
11	atf_check -e empty -o inline:"=" bintrans qp -u test
12	printf "=\ra" > test
13	atf_check -e empty -o inline:"=\ra" bintrans qp -u test
14	printf "=\r\na" > test
15	atf_check -e empty -o inline:"a" bintrans qp -u test
16	printf "This is a line" > test
17	atf_check -e empty -o inline:"This is a line" bintrans qp -u test
18	printf "This= is a line" > test
19	atf_check -e empty -o inline:"This= is a line" bintrans qp -u test
20	printf "This=2 is a line" > test
21	atf_check -e empty -o inline:"This=2 is a line" bintrans qp -u test
22	printf "This=23 is a line" > test
23	atf_check -e empty -o inline:"This# is a line" bintrans qp -u test
24	printf "This=3D is a line" > test
25	atf_check -e empty -o inline:"This= is a line" bintrans qp -u test
26	printf "This_ is a line" > test
27	atf_check -e empty -o inline:"This_ is a line" bintrans qp -u test
28	atf_check -e empty -o file:"$(atf_get_srcdir)/textqpdec" bintrans qp -u $(atf_get_srcdir)/textqpenc
29}
30
31atf_init_test_cases()
32{
33	atf_add_test_case decode_qp
34	atf_add_test_case encode_qp
35}
36