mirror of
https://github.com/sstephenson/bats.git
synced 2026-02-27 01:58:11 +01:00
saving $IFS in run() not altered for code using it
IFS was modified by run() becoming '\n' and so relying to its bash default was failing tests. Also some wrong tests corrected because was relying on this behavior to pass. Fix #89
This commit is contained in:
16
test/fixtures/bats/loop_keep_IFS.bats
vendored
Normal file
16
test/fixtures/bats/loop_keep_IFS.bats
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# see issue #89
|
||||
loop_func() {
|
||||
local search="none one two tree"
|
||||
local d
|
||||
|
||||
for d in $search ; do
|
||||
echo $d
|
||||
done
|
||||
}
|
||||
|
||||
@test "loop_func" {
|
||||
run loop_func
|
||||
[[ "${lines[3]}" == 'tree' ]]
|
||||
run loop_func
|
||||
[[ "${lines[2]}" == 'two' ]]
|
||||
}
|
||||
Reference in New Issue
Block a user