Print unit test failures better
parent
2abdf4c138
commit
73a2e81953
|
@ -214,14 +214,13 @@ M: condition error-help error>> error-help ;
|
|||
|
||||
M: assert summary drop "Assertion failed" ;
|
||||
|
||||
M: assert error.
|
||||
"Assertion failed" print
|
||||
M: assert-sequence summary drop "Assertion failed" ;
|
||||
|
||||
M: assert-sequence error.
|
||||
standard-table-style [
|
||||
15 length-limit set
|
||||
5 line-limit set
|
||||
[ expect>> [ [ "Expect:" write ] with-cell pprint-cell ] with-row ]
|
||||
[ got>> [ [ "Got:" write ] with-cell pprint-cell ] with-row ] bi
|
||||
] tabular-output nl ;
|
||||
[ "=== Expected:" print expected>> stack. ]
|
||||
[ "=== Got:" print got>> stack. ] bi
|
||||
] tabular-output ;
|
||||
|
||||
M: immutable summary drop "Sequence is immutable" ;
|
||||
|
||||
|
|
|
@ -568,8 +568,10 @@ M: sequence <=>
|
|||
2dup [ length ] bi@ =
|
||||
[ mismatch not ] [ 2drop f ] if ; inline
|
||||
|
||||
ERROR: assert-sequence got expected ;
|
||||
|
||||
: assert-sequence= ( a b -- )
|
||||
2dup sequence= [ 2drop ] [ assert ] if ;
|
||||
2dup sequence= [ 2drop ] [ assert-sequence ] if ;
|
||||
|
||||
: sequence-hashcode-step ( oldhash newpart -- newhash )
|
||||
>fixnum swap [
|
||||
|
|
Loading…
Reference in New Issue