# ========= Copyright 2026 @ Strukto.AI All Rights Reserved. ========= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ========= Copyright 2026 @ Strukto.AI All Rights Reserved. ========= def test_ifs_comma_splits_read(shell): out = shell.mirage('IFS=, read a b c <<< "1,2,3"; echo "$a:$b:$c"') assert out == "1:2:3\n" def test_ifs_default_whitespace(shell): out = shell.mirage('echo "1 2 3" | { read a b c; echo "$a:$b:$c"; }') assert out == "1:2:3\n" def test_ifs_prefix_does_not_persist(shell): out = shell.mirage('IFS=, read a b c <<< "1,2,3"; ' 'echo "${IFS-default}"') assert "," not in out def test_env_prefix_to_command(shell): out = shell.mirage('FOO=bar bash -c "echo $FOO"') assert "bar" in out def test_ifs_colon_split(shell): out = shell.mirage('IFS=: read a b c <<< "x:y:z"; echo "$a-$b-$c"') assert out == "x-y-z\n"