1
0
mirror of https://github.com/sstephenson/bats.git synced 2026-02-26 17:58:09 +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:
Sylvain
2015-01-29 20:51:49 +01:00
parent 3b33a5ac6a
commit 1735a4fcd2
4 changed files with 27 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ load() {
}
run() {
local e E T
local e E T oldIFS
[[ ! "$-" =~ e ]] || e=1
[[ ! "$-" =~ E ]] || E=1
[[ ! "$-" =~ T ]] || T=1
@@ -57,10 +57,12 @@ run() {
set +T
output="$("$@" 2>&1)"
status="$?"
oldIFS=$IFS
IFS=$'\n' lines=($output)
[ -z "$e" ] || set -e
[ -z "$E" ] || set -E
[ -z "$T" ] || set -T
IFS=$oldIFS
}
setup() {