• Oran Agra's avatar
    test infra: improve prints on failed assertions · a0cfd519
    Oran Agra authored
    sometimes we have several assertions with the same condition in the same test
    at different stages, and when these fail (the ones that print the condition
    text) you don't know which one it was. other assertions didn't print the
    condition text (variable names), just the expected and unexpected values.
    
    So now, all assertions print context line, and conditin text.
    
    besides, one of the major differences between 'assert' and 'assert_equal',
    is that the later is able to print the value that doesn't match the expected.
    if there is a rare non-reproducible failure, it is helpful to know what was
    the value the test encountered and how far it was from the threshold.
    
    So now, adding assert_lessthan and assert_range that can be used in some places.
    were we used just 'assert { a > b }' so far.
    a0cfd519
test.tcl 5.19 KB