lizardfs/lizardfs — pull request #143 by marcinsulikowski (2014-02-14 12:10:53+00:00)
Title: tests: Improve assertion failure messages

Consider the following test:

a=500
b=90
expect_less_or_equal $a $b

This code produced the following, not very user-friendly error:

FAILURE [2014-02-14 13:04:17] Expected: '500' <= '90'

This commit introduces more descriptive messages, ie:

FAILURE [2014-02-14 13:04:47] Assertion 'expect_less_or_equal $a $b' failed
Expected: '500' <= '90'
Location: test_assert.sh:3

If the custom message is used, eg:

MESSAGE="Checking simple arithmetics" expect_less_or_equal $a $b

the error message will look like this:

FAILURE [2014-02-14 13:04:47] Checking simple arithmetics: Assertion 'expect_less_or_equal $a $b' failed
Expected: '500' <= '90'
Location: test_assert.sh:3