Skip to content

Commit 264f618

Browse files
committed
Fix formatting of output messages
1 parent cefb082 commit 264f618

8 files changed

+56
-64
lines changed

test/test-custom.4th

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
s" custom messages" describe#{
44

5-
:noname ." Just passed" cr ; ^passed. !
6-
:noname ." Just failed" cr ; ^different. !
5+
:noname ." Just passed" ; ^passed. !
6+
:noname ." Just failed" ; ^different. !
77

88
s" short strings" it#{
99
<{ s" Hello World!" s# -> s" Hello World!" s# }>
@@ -17,8 +17,8 @@ s" custom messages" describe#{
1717
2variable actual$
1818
2variable expected$
1919

20-
:noname ." Got '" actual$ 2@ type ." ' as expected" cr ; ^passed. !
21-
:noname ." Expected '" expected$ 2@ type ." ', got '" actual$ 2@ type ." '" cr ; ^different. !
20+
:noname ." Got '" actual$ 2@ type ." ' as expected" ; ^passed. !
21+
:noname ." Expected '" expected$ 2@ type ." ', got '" actual$ 2@ type ." '" ; ^different. !
2222

2323
: &actual 2dup actual$ 2! ;
2424
: &expected 2dup expected$ 2! ;

test/test-mixed.expected

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,40 @@
99

1010
<PASSED::>Test Passed
1111

12-
<FAILED::>Wrong number of cell results, expected 1 , got 2
12+
<FAILED::>Wrong number of cell results, expected 1 , got 2
1313

1414
<FAILED::>Wrong number of float results, expected 1 , got 2
1515

16-
<FAILED::>Wrong number of cell results, expected 2 , got 3
16+
<FAILED::>Wrong number of cell results, expected 2 , got 3
1717

1818
<FAILED::>Wrong number of float results, expected 1 , got 2
1919

20-
<FAILED::>Wrong number of cell results, expected 2 , got 3
20+
<FAILED::>Wrong number of cell results, expected 2 , got 3
2121

2222
<FAILED::>Wrong number of float results, expected 1 , got 2
2323

24-
<FAILED::>Wrong number of cell results, expected 3 , got 4
24+
<FAILED::>Wrong number of cell results, expected 3 , got 4
2525

2626
<FAILED::>Wrong number of float results, expected 3 , got 4
2727

28-
<FAILED::>Wrong number of cell results, expected 3 , got 4
28+
<FAILED::>Wrong number of cell results, expected 3 , got 4
2929

3030
<FAILED::>Wrong number of float results, expected 3 , got 4
3131

32-
<FAILED::>Wrong number of cell results, expected 1 , got 2
33-
<:LF:>Wrong number of float results, expected 1 , got 2
32+
<FAILED::>Wrong number of cell results, expected 1 , got 2 <:LF:>Wrong number of float results, expected 1 , got 2
3433

35-
<FAILED::>Wrong number of cell results, expected 1 , got 2
36-
<:LF:>Wrong number of float results, expected 1 , got 2
34+
<FAILED::>Wrong number of cell results, expected 1 , got 2 <:LF:>Wrong number of float results, expected 1 , got 2
3735

38-
<FAILED::>Wrong number of cell results, expected 1 , got 2
39-
<:LF:>Wrong number of float results, expected 1 , got 2
36+
<FAILED::>Wrong number of cell results, expected 1 , got 2 <:LF:>Wrong number of float results, expected 1 , got 2
4037

4138
<FAILED::>Expected 2 , got 1
4239

4340
<FAILED::>Expected 1. , got 2.
4441

45-
<FAILED::>Expected 2 , got 1
46-
<:LF:>Expected 1. , got 2.
42+
<FAILED::>Expected 2 , got 1 <:LF:>Expected 1. , got 2.
4743

4844
<FAILED::>Expected 4 5 6 , got 1 2 3
4945

5046
<FAILED::>Expected 1. 2. 3. , got 4. 5. 6.
5147

52-
<FAILED::>Expected 4 5 6 , got 1 2 3
53-
<:LF:>Expected 1. 2. 3. , got 4. 5. 6.
48+
<FAILED::>Expected 4 5 6 , got 1 2 3 <:LF:>Expected 1. 2. 3. , got 4. 5. 6.
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11

22
<PASSED::>Test Passed
33

4-
<FAILED::>Too many cell results to test
4+
<FAILED::>Too many cell results to test
55

66
<FAILED::>Too many float results to test
77

8-
<FAILED::>Too many cell results to test
9-
<:LF:>Too many float results to test
8+
<FAILED::>Too many cell results to test<:LF:>Too many float results to test
109

11-
<FAILED::>Too many cell results to test
10+
<FAILED::>Too many cell results to test
1211

1312
<FAILED::>Too many float results to test
1413

15-
<FAILED::>Too many cell results to test
16-
<:LF:>Too many float results to test
14+
<FAILED::>Too many cell results to test<:LF:>Too many float results to test
1715

18-
<FAILED::>Too many cell results to test
16+
<FAILED::>Too many cell results to test
1917

2018
<FAILED::>Too many float results to test
2119

22-
<FAILED::>Too many expected cell results to test
20+
<FAILED::>Too many expected cell results to test
2321

2422
<FAILED::>Too many expected float results to test
2523

26-
<FAILED::>Too many expected cell results to test
27-
<:LF:>Too many expected float results to test
24+
<FAILED::>Too many expected cell results to test<:LF:>Too many expected float results to test

test/test-stack-mismatch.expected

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33

44
<IT::>single test
55

6-
<FAILED::>Wrong number of cell results, expected 1 , got 2
6+
<FAILED::>Wrong number of cell results, expected 1 , got 2
77

8-
<COMPLETEDIN::>0.023 ms
8+
<COMPLETEDIN::>0.015 ms
99

1010
<IT::>double test
1111

12-
<FAILED::>Wrong number of cell results, expected 1 , got 2
12+
<FAILED::>Wrong number of cell results, expected 1 , got 2
1313

1414
<PASSED::>Test Passed
1515

16-
<COMPLETEDIN::>0.016 ms
16+
<COMPLETEDIN::>0.013 ms
1717

1818
<IT::>double fail test
1919

20-
<FAILED::>Wrong number of cell results, expected 1 , got 2
20+
<FAILED::>Wrong number of cell results, expected 1 , got 2
2121

22-
<FAILED::>Wrong number of cell results, expected 3 , got 1
22+
<FAILED::>Wrong number of cell results, expected 3 , got 1
2323

24-
<COMPLETEDIN::>0.018 ms
24+
<COMPLETEDIN::>0.014 ms
2525

26-
<COMPLETEDIN::>0.078 ms
26+
<COMPLETEDIN::>0.058 ms

test/test-stack-underflow.expected

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ float stack unbalanced
99

1010
<PASSED::>Test Passed
1111

12-
<COMPLETEDIN::>0.010 ms
12+
<COMPLETEDIN::>0.012 ms
1313

14-
<COMPLETEDIN::>0.016 ms
14+
<COMPLETEDIN::>0.018 ms
1515
cell stack balanced
1616
float stack balanced
1717

1818
<DESCRIBE::>simple underflow
1919

2020
<IT::>single test
2121

22-
<FAILED::>Wrong number of cell results, expected 1 , got a 1 cell stack underflow
22+
<FAILED::>Wrong number of cell results, expected 1 , got a 1 cell stack underflow
2323

2424
<COMPLETEDIN::>0.008 ms
2525

@@ -31,55 +31,55 @@ float stack balanced
3131

3232
<IT::>single test
3333

34-
<FAILED::>Wrong number of cell results, expected 1 , got a 1 cell stack underflow
34+
<FAILED::>Wrong number of cell results, expected 1 , got a 1 cell stack underflow
3535

3636
<COMPLETEDIN::>0.008 ms
3737

3838
<IT::>double test
3939

40-
<FAILED::>Wrong number of cell results, expected 1 , got a 1 cell stack underflow
40+
<FAILED::>Wrong number of cell results, expected 1 , got a 1 cell stack underflow
4141

42-
<FAILED::>Wrong number of cell results, expected 1 , got a 2 cell stack underflow
42+
<FAILED::>Wrong number of cell results, expected 1 , got a 2 cell stack underflow
4343

44-
<COMPLETEDIN::>1698095971439.486 ms
44+
<COMPLETEDIN::>1698623934121.134 ms
4545

4646
<IT::>double test
4747

48-
<FAILED::>Wrong number of cell results, expected 2 , got a 1 cell stack underflow
48+
<FAILED::>Wrong number of cell results, expected 2 , got a 1 cell stack underflow
4949

50-
<FAILED::>Wrong number of cell results, expected 2 , got a 2 cell stack underflow
50+
<FAILED::>Wrong number of cell results, expected 2 , got a 2 cell stack underflow
5151

52-
<COMPLETEDIN::>1698095971439.504 ms
52+
<COMPLETEDIN::>1698623934121.154 ms
5353

5454
<IT::>double test
5555

56-
<FAILED::>Wrong number of cell results, expected 2 , got a 1 cell stack underflow
56+
<FAILED::>Wrong number of cell results, expected 2 , got a 1 cell stack underflow
5757

58-
<FAILED::>Wrong number of cell results, expected 1 , got a 2 cell stack underflow
58+
<FAILED::>Wrong number of cell results, expected 1 , got a 2 cell stack underflow
5959

60-
<COMPLETEDIN::>1698095971439.522 ms
60+
<COMPLETEDIN::>1698623934121.172 ms
6161

6262
<IT::>float test
6363

6464
<FAILED::>Wrong number of float results, expected 1 , got a 1 float stack underflow
6565

66-
<COMPLETEDIN::>0.008 ms
66+
<COMPLETEDIN::>0.009 ms
6767

6868
<IT::>double float test
6969

7070
<FAILED::>Wrong number of float results, expected 1 , got a 1 float stack underflow
7171

7272
<FAILED::>Wrong number of float results, expected 1 , got a 2 float stack underflow
7373

74-
<COMPLETEDIN::>0.022 ms
74+
<COMPLETEDIN::>0.014 ms
7575

7676
<IT::>double float test
7777

7878
<FAILED::>Wrong number of float results, expected 2 , got a 1 float stack underflow
7979

8080
<FAILED::>Wrong number of float results, expected 2 , got a 2 float stack underflow
8181

82-
<COMPLETEDIN::>0.015 ms
82+
<COMPLETEDIN::>0.016 ms
8383

8484
<IT::>double float test
8585

@@ -89,6 +89,6 @@ float stack balanced
8989

9090
<COMPLETEDIN::>0.015 ms
9191

92-
<COMPLETEDIN::>0.142 ms
92+
<COMPLETEDIN::>0.138 ms
9393
cell stack balanced
9494
float stack balanced
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
<FAILED::>Wrong number of cell results, expected 2 , got 1
2+
<FAILED::>Wrong number of cell results, expected 2 , got 1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
<FAILED::>Wrong number of cell results, expected 1 , got 2
2+
<FAILED::>Wrong number of cell results, expected 1 , got 2

testest.4th

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@ F<>: f<>
6363

6464
\ default reporting
6565

66-
: passed. ." Test Passed" cr ;
67-
: (different.) { e[] a[] '@ '. } e[] []> a[] [0] { n s c e* a* } n if ?lf# ." Expected " e[] '@ '. []. ." , got " a[] '@ '. []. cr lf ++ then ;
66+
: passed. ." Test Passed" ;
67+
: (different.) { e[] a[] '@ '. } e[] []> a[] [0] { n s c e* a* } n if ?lf# ." Expected " e[] '@ '. []. ." , got " a[] '@ '. []. lf ++ then ;
6868
: different. expecteds[] actuals[] ['] @ ['] . (different.) ;
6969
: fdifferent. expecteds.f[] actuals.f[] ['] f@ ['] f. (different.) ;
7070
: (#results.) { e[] a[] s* s# } e[] []> a[] []> { #e es ec e* #a as ac a* }
71-
#a ac > if ?lf# ." Too many " s* s# type ." results to test" cr lf ++ exit then
72-
#e ec > if ?lf# ." Too many expected " s* s# type ." results to test" cr lf ++ exit then
71+
#a ac > if ?lf# ." Too many " s* s# type ." results to test" lf ++ exit then
72+
#e ec > if ?lf# ." Too many expected " s* s# type ." results to test" lf ++ exit then
7373
#e #a - dup if
7474
?lf# ." Wrong number of " s* s# type ." results, expected " #e .
75-
." , got " #a dup 0< if negate ." a " . s* s# type ." stack underflow" else . then cr lf ++
75+
." , got " #a dup 0< if negate ." a " . s* s# type ." stack underflow" else . then lf ++
7676
else drop then ;
77-
: #results. expecteds[] actuals[] s" cell" (#results.) ;
77+
: #results. expecteds[] actuals[] s" cell " (#results.) ;
7878
: #fresults. expecteds.f[] actuals.f[] s" float" (#results.) ;
7979

8080
\ custom reporting
@@ -96,8 +96,8 @@ variable ^#fresults. ' #fresults. ^#fresults. !
9696
#results expecteds[] tuck ! #fresults expecteds.f[] tuck ! store-stacks reset-stacks
9797
0 0 0 expecteds[] actuals[] ['] compare-result compare-results { #p #f #r } \ compare cells
9898
#p 0 0 expecteds.f[] actuals.f[] ['] fcompare-result compare-results { #pt #ff #rf } \ compare floats
99-
#r #rf + #f #ff + + if failed# #r ^#results. ?@^ #rf ^#fresults. ?@^ #f ^different. ?@^ #ff ^fdifferent. ?@^
100-
else #pt 2 = if passed# ^passed. @ ^ then then reset-stacks ;
99+
#r #rf + #f #ff + + if failed# #r ^#results. ?@^ #rf ^#fresults. ?@^ #f ^different. ?@^ #ff ^fdifferent. ?@^ cr
100+
else #pt 2 = if passed# ^passed. @ ^ cr then then reset-stacks ;
101101

102102
\ testest utility words
103103

0 commit comments

Comments
 (0)