Skip to content

Commit 5fe46a0

Browse files
committed
pull sstephenson#90 quote every string compare
test are all successful.
1 parent 1735a4f commit 5fe46a0

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

test/bats.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ fixtures bats
3030
@test "empty test file runs zero tests" {
3131
run bats "$FIXTURE_ROOT/empty.bats"
3232
[ $status -eq 0 ]
33-
[ $output = "1..0" ]
33+
[ "$output" = "1..0" ]
3434
}
3535

3636
@test "one passing test" {
3737
run bats "$FIXTURE_ROOT/passing.bats"
3838
[ $status -eq 0 ]
39-
[ ${lines[0]} = "1..1" ]
39+
[ "${lines[0]}" = "1..1" ]
4040
[ "${lines[1]}" = "ok 1 a passing test" ]
4141
}
4242

test/suite.bats

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@ fixtures suite
66
@test "running a suite with no test files" {
77
run bats "$FIXTURE_ROOT/empty"
88
[ $status -eq 0 ]
9-
[ $output = "1..0" ]
9+
[ "$output" = "1..0" ]
1010
}
1111

1212
@test "running a suite with one test file" {
1313
run bats "$FIXTURE_ROOT/single"
1414
[ $status -eq 0 ]
15-
[ ${lines[0]} = "1..1" ]
15+
[ "${lines[0]}" = "1..1" ]
1616
[ "${lines[1]}" = "ok 1 a passing test" ]
1717
}
1818

1919
@test "counting tests in a suite" {
2020
run bats -c "$FIXTURE_ROOT/single"
2121
[ $status -eq 0 ]
22-
[ $output -eq 1 ]
22+
[ "$output" -eq 1 ]
2323

2424
run bats -c "$FIXTURE_ROOT/multiple"
2525
[ $status -eq 0 ]
26-
[ $output -eq 3 ]
26+
[ "$output" -eq 3 ]
2727
}
2828

2929
@test "aggregated output of multiple tests in a suite" {
3030
run bats "$FIXTURE_ROOT/multiple"
3131
[ $status -eq 0 ]
32-
[ ${lines[0]} = "1..3" ]
32+
[ "${lines[0]}" = "1..3" ]
3333
echo "$output" | grep "^ok . truth"
3434
echo "$output" | grep "^ok . more truth"
3535
echo "$output" | grep "^ok . quasi-truth"
@@ -38,14 +38,14 @@ fixtures suite
3838
@test "a failing test in a suite results in an error exit code" {
3939
FLUNK=1 run bats "$FIXTURE_ROOT/multiple"
4040
[ $status -eq 1 ]
41-
[ ${lines[0]} = "1..3" ]
41+
[ "${lines[0]}" = "1..3" ]
4242
echo "$output" | grep "^not ok . quasi-truth"
4343
}
4444

4545
@test "running an ad-hoc suite by specifying multiple test files" {
4646
run bats "$FIXTURE_ROOT/multiple/a.bats" "$FIXTURE_ROOT/multiple/b.bats"
4747
[ $status -eq 0 ]
48-
[ ${lines[0]} = "1..3" ]
48+
[ "${lines[0]}" = "1..3" ]
4949
echo "$output" | grep "^ok . truth"
5050
echo "$output" | grep "^ok . more truth"
5151
echo "$output" | grep "^ok . quasi-truth"

0 commit comments

Comments
 (0)