sstephenson / bats

Bash Automated Testing System
MIT License
7.12k stars 518 forks source link

Special char in output are handled (quoted?) differently in $lines and $output #207

Open mapio opened 7 years ago

mapio commented 7 years ago

Save the following test in a file named bug.bats

@test "stars are bad" {
    run echo '*'
    [ "${lines[0]}" == "bug.bats" ]
    [ "$output" == "*" ]
}

and run it. In one way or another, it should return a failure: there is just one output line and it can't be at the same time equal to bug.bats and *. But there is no failuer

✓ stars are bad
1 test, 0 failures

This seems to be due to the fact that in $output the * emitted by echo is correctly quoted, while the same does not happen for $lines.