aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/bintrans/tests/bintrans_test.sh
blob: b1f9d8f6d1d608ac80b8ddcd78225c77f4e943d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
atf_test_case encode_qp
encode_qp_body()
{
	atf_check -e empty -o file:"$(atf_get_srcdir)/textqpenc" bintrans qp $(atf_get_srcdir)/textqpdec
}

atf_test_case decode_qp
decode_qp_body()
{
	printf "=" > test
	atf_check -e empty -o inline:"=" bintrans qp -u test
	printf "=\ra" > test
	atf_check -e empty -o inline:"=\ra" bintrans qp -u test
	printf "=\r\na" > test
	atf_check -e empty -o inline:"a" bintrans qp -u test
	printf "This is a line" > test
	atf_check -e empty -o inline:"This is a line" bintrans qp -u test
	printf "This= is a line" > test
	atf_check -e empty -o inline:"This= is a line" bintrans qp -u test
	printf "This=2 is a line" > test
	atf_check -e empty -o inline:"This=2 is a line" bintrans qp -u test
	printf "This=23 is a line" > test
	atf_check -e empty -o inline:"This# is a line" bintrans qp -u test
	printf "This=3D is a line" > test
	atf_check -e empty -o inline:"This= is a line" bintrans qp -u test
	printf "This_ is a line" > test
	atf_check -e empty -o inline:"This_ is a line" bintrans qp -u test
	atf_check -e empty -o file:"$(atf_get_srcdir)/textqpdec" bintrans qp -u $(atf_get_srcdir)/textqpenc
}

atf_init_test_cases()
{
	atf_add_test_case decode_qp
	atf_add_test_case encode_qp
}