Skip to content

Commit

Permalink
Relabel
Browse files Browse the repository at this point in the history
  • Loading branch information
nomennescio committed Oct 22, 2023
1 parent 76748bc commit 93bfad1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions testest.4th
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ variable #expecteds.f create expecteds.f[] 32 floats allot
: restore-stack ( -- ... ) depth { d } start-depth @ d +do 0 loop d start-depth @ +do drop loop ;
: restore-fstack ( -- ) fdepth { fd } start-fdepth @ fd +do 0e loop fd start-fdepth @ +do fdrop loop ;

: passed$ ." Test Passed" cr ;
: passed$ ." Test Passed" cr ;

: (different$) { r* e* a* 's '@ '. }
r* @ dup if ?lf# ." Expected " 0 r* @ -do e* i 1- 's ^ + '@ ^ '. ^ 1 -loop ." , got " 0 r* @ -do a* i 1- 's ^ + '@ ^ '. ^ 1 -loop cr lf ++ then ;
Expand All @@ -48,11 +48,11 @@ variable #expecteds.f create expecteds.f[] 32 floats allot
: #results$ #expecteds @ #actuals @ s" cell " (#results$) ;
: #results.f$ #expecteds.f @ #actuals.f @ s" float " (#results$) ;

variable ^passed ' passed$ ^passed !
variable ^different ' different$ ^different !
variable ^different.f ' different.f$ ^different.f !
variable ^#results ' #results$ ^#results !
variable ^#results.f ' #results.f$ ^#results.f !
variable ^passed$ ' passed$ ^passed$ !
variable ^different$ ' different$ ^different$ !
variable ^different.f$ ' different.f$ ^different.f$ !
variable ^#results$ ' #results$ ^#results$ !
variable ^#results.f$ ' #results.f$ ^#results.f$ !

: <{ depth start-depth ! fdepth start-fdepth ! lf 0! ;

Expand Down Expand Up @@ -94,8 +94,8 @@ fvariable epsilon
restore-stack restore-fstack
0 0 0 #expecteds @ expecteds[] #actuals @ actuals[] cell ['] compare compare-results { #p #f #r } \ compare cells
#p 0 0 #expecteds.f @ expecteds.f[] #actuals.f @ actuals.f[] float ['] compare.f compare-results { #p #ff #rf } \ compare floats
#r #rf + #f #ff + + if failed# #r ^#results ?@^ #rf ^#results.f ?@^ #f ^different ?@^ #ff ^different.f ?@^
else #p 2 = if passed# ^passed @ ^ then then ;
#r #rf + #f #ff + + if failed# #r ^#results$ ?@^ #rf ^#results.f$ ?@^ #f ^different$ ?@^ #ff ^different.f$ ?@^
else #p 2 = if passed# ^passed$ @ ^ then then ;

3037000493 constant #m \ prime number < sqrt (2^63-1)
53 constant #p \ prime number
Expand Down

0 comments on commit 93bfad1

Please sign in to comment.