Skip to content

Fixed race conditions#4

Open
riquito wants to merge 3 commits into
lehmannro:masterfrom
riquito:master
Open

Fixed race conditions#4
riquito wants to merge 3 commits into
lehmannro:masterfrom
riquito:master

Conversation

@riquito

@riquito riquito commented Jun 10, 2013

Copy link
Copy Markdown

assert.sh fail in a couple cases

  1. using assert, if your tested command has as parameter a string with a space separated asterisk then the asterisk will be evaluated by the shell.

  2. using assert, if your tested command has as parameter a string with characters that have a special meaning in printf, printf will output something unexpected

I suspect that in assert_raises
(eval $1 <<< ${3:-}) > /dev/null 2>&1
should really be written as
(eval "$1" <<< ${3:-}) > /dev/null 2>&1

but I can't produce a test case similar to 1)

p.s.
I couldn't figure out the meaning of "x required to overwrite older results": is it still needed once printf is gone?

@riquito

riquito commented Jun 10, 2013

Copy link
Copy Markdown
Author

It still fails with
assert "echo "a\nb"" "a\nb"

result is

test #10 "echo "a\nb"" failed:
expected "a\nb"
got "a\nb"

This happens with or without my pull request.

It's compairing the literal "a\nb" (4 letters) with "a
b" (3 letters) (the error message doesn't help here)

@riquito

riquito commented Jun 10, 2013

Copy link
Copy Markdown
Author

The latest commit ( df02b94 ) should solve the newline problem

@lehmannro

Copy link
Copy Markdown
Owner

I don't see commit df02b94 in this pull request or your repository. Could you recheck if you've pushed it?

@riquito

riquito commented Jun 12, 2013

Copy link
Copy Markdown
Author

It's two days that I wait for github to update the page (via git I see it pushed). Alas, it has finally appeared, you should be able to see it.

@mnothic

mnothic commented Nov 13, 2013

Copy link
Copy Markdown

hi I have a problem with this assert
bash test.sh
test #24 "get_color red" failed:
expected "\032[0;31m"
got "\033[0;31m"
1 of 25 tests failed in 0.171s.

@lehmannro

Copy link
Copy Markdown
Owner

It looks like indeed your expected output and the result are different —
one has \032, the other has \033.

For future problems, please also open a new ticket instead of amending an
existing, unrelated issue.

@mnothic

mnothic commented Nov 13, 2013

Copy link
Copy Markdown

Sorry, my fault, but with the same string still failing

test #24 "get_color red" failed:
expected "\033[0;31m"
got "\033[0;31m"
1 of 25 tests failed in 0.086s.

@joseluis joseluis mentioned this pull request Dec 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants