]> Tony Duckles's Git Repositories (git.nynim.org) - svn2svn.git/blob - tests/test-lib-functions.sh
Fix typo in comment
[svn2svn.git] / tests / test-lib-functions.sh
1 #!/bin/sh
2
3 test_expect_failure () {
4 test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq=
5 test "$#" = 2 ||
6 error "bug in the test script: not 2 or 3 parameters to test-expect-failure"
7 export test_prereq
8 if ! test_skip "$@"
9 then
10 say >&3 "checking known breakage: $2"
11 if test_run_ "$2" expecting_failure
12 then
13 test_failure_ "$1"
14 else
15 test_ok_ "$1"
16 fi
17 fi
18 echo >&3 ""
19 }
20
21 test_expect_success () {
22 test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq=
23 test "$#" = 2 ||
24 error "bug in the test script: not 2 or 3 parameters to test-expect-success"
25 export test_prereq
26 if ! test_skip "$@"
27 then
28 say >&3 "expecting success: $2"
29 if test_run_ "$2"
30 then
31 test_ok_ "$1"
32 else
33 test_failure_ "$@"
34 fi
35 fi
36 echo >&3 ""
37 }
38