File: test_subst_syntax.bats

package info (click to toggle)
dh-exec 0.31
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 324 kB
  • sloc: ansic: 530; perl: 178; makefile: 126; sh: 67
file content (31 lines) | stat: -rwxr-xr-x 697 bytes parent folder | download | duplicates (9)
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
## -*- shell-script -*-

load "test.lib"

@test "subst: calling without arguments is valid" {
        run_dh_exec src/dh-exec-subst <<EOF
EOF

        expect_output ""
}

@test "subst: calling as a she-bang works" {
        run_dh_exec_with_input <<EOF
#! ${top_builddir}/src/dh-exec-subst
nothing = ${top_builddir}
EOF

        expect_output "nothing = ${top_builddir}"
}

@test "subst: calling with too many arguments fails" {
        run_dh_exec src/dh-exec-subst too many arguments

        expect_error "no argument at all"
}

@test "subst: calling with a non-existing file fails" {
        run_dh_exec src/dh-exec-subst --invalid-file--

        expect_error "can't open --invalid-file--"
}