sstephenson / bats

Bash Automated Testing System
MIT License
7.13k stars 517 forks source link

Inconsistent quote expansion within testcase #87

Open RomanSaveljev opened 9 years ago

RomanSaveljev commented 9 years ago

This is the testcase, which demonstates the failure:

#!/usr/bin/env bats

@test 't' {
        #set -x
        command="echo -e"
        $command I SUCCEED
        set -o >before.txt
        run true
        echo $command
        set -o >after.txt
        $command I FAIL
}

Tracing reveals that I FAIL line is called as: 'echo -e' I FAIL and the interpreter tries to call exactly the quoted command.