Skip to content

Commit b7caa1b

Browse files
committed
test: add data provider tests containing eval gotchas
The new data provider parser uses `eval`, which bears some risks and may lead to unexpected behavior on existing test cases. Add some tests containing potential gotchas. These all fail or - even worse - make bashunit die completely.
1 parent 8276e81 commit b7caa1b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/functional/provider_test.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,18 @@ function test_value_with_whitespace_from_data_provider() {
6666
function provide_value_with_whitespace() {
6767
data_set "first value" "second value"
6868
}
69+
70+
# @data_provider provide_eval_gotchas
71+
function test_eval_gotchas_from_data_provider() {
72+
input=$1
73+
expected=$2
74+
assert_equals "${input}" "${expected}"
75+
}
76+
77+
function provide_eval_gotchas() {
78+
echo "*" "*"
79+
echo "|" "|"
80+
echo "&" "&"
81+
echo ";" ";"
82+
echo "1;2" "1;2"
83+
}

0 commit comments

Comments
 (0)