bash_unit icon indicating copy to clipboard operation
bash_unit copied to clipboard

fake with here docs will interpret quote too much

Open pgrangelgo opened this issue 6 years ago • 0 comments

When using quotes inside here doc in the context of fake, the quote will disappear from the output of the faked function. This is different from what is expected from using here doc.

Here is an exemple:

test_should_succeed_but_will_fail() {
  fake toto <<EOF
"test"
EOF

  assert 'toto | grep \"' 'should have found quote but seems like fake swallowed it'
}

test_will_succeed() {
  fake toto <<EOF
\"test\"
EOF

  assert 'toto | grep \"'
}

pgrangelgo avatar Nov 29 '18 09:11 pgrangelgo