1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-09-29 20:48:27 +02:00

preprocess: Add tests for vars, quotes in names

This is in anticipation of refactoring away the `$(eval echo
"$quoted_name")` command substitution.
This commit is contained in:
Mike Bland 2017-02-15 12:04:03 -05:00
parent fac51df957
commit 3ab495fda2
No known key found for this signature in database
GPG Key ID: 5121C73A6E07384B
3 changed files with 28 additions and 0 deletions

View File

@ -268,3 +268,17 @@ fixtures bats
[ $status -eq 0 ]
[ "${lines[1]}" = "ok 1 loop_func" ]
}
@test "expand variables in test name" {
SUITE='test/suite' run bats "$FIXTURE_ROOT/expand_var_in_test_name.bats"
[ $status -eq 0 ]
[ "${lines[1]}" = "ok 1 test/suite: test with variable in name" ]
}
@test "handle quoted and unquoted test names" {
run bats "$FIXTURE_ROOT/quoted_and_unquoted_test_names.bats"
[ $status -eq 0 ]
[ "${lines[1]}" = "ok 1 single-quoted name" ]
[ "${lines[2]}" = "ok 2 double-quoted name" ]
[ "${lines[3]}" = "ok 3 unquoted" ]
}

View File

@ -0,0 +1,3 @@
@test "$SUITE: test with variable in name" {
true
}

View File

@ -0,0 +1,11 @@
@test 'single-quoted name' {
true
}
@test "double-quoted name" {
true
}
@test unquoted {
true
}