File: mockup-functions-tests.sh

package info (click to toggle)
dbconfig-common 2.0.25
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,184 kB
  • sloc: sh: 1,487; makefile: 51; sql: 40; perl: 12
file content (29 lines) | stat: -rwxr-xr-x 676 bytes parent folder | download | duplicates (6)
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
#!/bin/sh

# get some common functions
. $(dirname "$0")/functions

test_mockup_retval(){
    local ret errone errtwo
    mockup -r 1 huh
    errone=$mockup_errorfile
    mockup -r 0 huh
    errtwo=$mockup_errorfile
    huh
    ret=$?
    assertFalse "mockup failed" $ret
    [ $ret -eq 0 ] || cat "$errone"
    huh
    ret=$?
    assertTrue "mockup failed" $ret
    [ $ret -eq 0 ] || cat "$errtwo"
}

test_mockup_save_cmdline(){
    mockup foo
    foo one "two three" four "five'six"
    assertTrue "mockup did not set cmdline file" "test -n '${mockup_cmdline:-}'"
    assertFilesEqual ./data/mock_save_cmdline.cmdline.foo.txt $mockup_cmdline
}

. /usr/share/shunit2/shunit2