Skip to content

Commit

Permalink
Don't export IFS outside testcase function
Browse files Browse the repository at this point in the history
The run-test.sh script depends on field splitting to pass the correct
option to the diff utility in the testcase function. This means the
function should be called with the default IFS. This commit modifies the
test case that needs a non-default IFS to export it only inside the test
case script.

Fixes #50
  • Loading branch information
magicant committed May 11, 2024
1 parent b59ed7c commit 89f5387
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/fsplit-p.tst
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ __IN__
]
__OUT__

(
export IFS=X

test_o 'default IFS (overriding environment variable)'
IFS=X $TESTEE <<\__INNER__
printf "[%s]\n" "$IFS"
__INNER__
__IN__
[
]
__OUT__

)

test_oE -e 0 'field splitting applies to results of expansions'
IFS=' 0' a='1 2'
bracket -${a}- -$(echo '3 4')- -`echo '5 6'`- -$((708))-
Expand Down

0 comments on commit 89f5387

Please sign in to comment.