1# $FreeBSD: releng/11.0/usr.bin/soelim/tests/soelim.sh 282425 2015-05-04 18:20:31Z bapt $ 2 3atf_test_case stdin 4stdin_head() 5{ 6 atf_set "descr" "stdin functionality" 7} 8 9stdin_body() 10{ 11 # no file after .so 12 atf_check \ 13 -o inline:".so\n" \ 14 -e empty \ 15 -s exit:0 \ 16 soelim <<-EOF 17.so 18EOF 19 20 # only space after .so 21 atf_check \ 22 -o inline:".so \n" \ 23 -e empty \ 24 -s exit:0 \ 25 soelim <<-EOF 26.so 27EOF 28 29 # explicit stdin 30 atf_check \ 31 -o inline:".so\n" \ 32 -e empty \ 33 -s exit:0 \ 34 soelim - <<-EOF 35.so 36EOF 37 38 atf_check \ 39 -o empty \ 40 -e inline:"soelim: can't open 'afile': No such file or directory\n" \ 41 -s exit:1 \ 42 soelim <<-EOF 43.so afile 44EOF 45 46 atf_check \ 47 -o inline:".soafile\n" \ 48 -e empty \ 49 -s exit:0 \ 50 soelim <<-EOF 51.soafile 52EOF 53 54 atf_check \ 55 -o empty \ 56 -e inline:"soelim: can't open 'afile': No such file or directory\n" \ 57 -s exit:1 \ 58 soelim -C <<-EOF 59.soafile 60EOF 61} 62 63atf_test_case files 64files_head() 65{ 66 atf_set "descr" "testing files" 67} 68 69files_body() 70{ 71 atf_check \ 72 -o inline:"This is a test\n" \ 73 -e inline:"soelim: can't open 'nonexistingfile': No such file or directory\n" \ 74 -s exit:1 \ 75 soelim $(atf_get_srcdir)/nonexisting.in 76 77 cp $(atf_get_srcdir)/basic . 78 atf_check \ 79 -o file:$(atf_get_srcdir)/basic.out \ 80 -e empty \ 81 -s exit:0 \ 82 soelim $(atf_get_srcdir)/basic.in 83 84 rm -f basic 85 atf_check \ 86 -o file:$(atf_get_srcdir)/basic.out \ 87 -e empty \ 88 -s exit:0 \ 89 soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic.in 90 91 atf_check \ 92 -o file:$(atf_get_srcdir)/basic-with-space.out \ 93 -e empty \ 94 -s exit:0 \ 95 soelim -I$(atf_get_srcdir) $(atf_get_srcdir)/basic-with-space.in 96 97} 98 99atf_init_test_cases() 100{ 101 atf_add_test_case stdin 102 atf_add_test_case files 103} 104