bats icon indicating copy to clipboard operation
bats copied to clipboard

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

Open mapio opened this issue 7 years ago • 0 comments

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.

mapio avatar Feb 08 '17 23:02 mapio