Skip to content

Commit eca12fe

Browse files
authored
Merge pull request #11 from nomennescio/enhancement-#10
Show actual and expected results with bottom of stack first, and top of stack last
2 parents 2df3bb6 + ba59b81 commit eca12fe

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

test/test-expected-actual.4th

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
\ Copyright 2019 nomennescio
2+
s" Expected results and actual results tests" describe#{
3+
s" Match" it#{
4+
<{ 0 1 2 3 -> 0 1 2 3 }>
5+
}#
6+
s" Mismatch" it#{
7+
<{ 0 1 2 3 -> 4 5 6 7 }>
8+
}#
9+
}#

test/test-expected-actual.expected

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
<DESCRIBE::>Expected results and actual results tests
3+
4+
<IT::>Match
5+
6+
<PASSED::>Test Passed
7+
8+
<COMPLETEDIN::>0.039 ms
9+
10+
<IT::>Mismatch
11+
12+
<FAILED::>Expected 4 5 6 7 , got 0 1 2 3
13+
14+
<COMPLETEDIN::>0.067 ms
15+
16+
<COMPLETEDIN::>0.296 ms

ttester-codewars.4th

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ variable ^different
2121

2222
: passed$ ." Test Passed" cr ;
2323
: different$ ." Expected "
24-
RESULTS @ 0 +do EXPECTED-RESULTS i cells + @ . loop
24+
0 RESULTS @ -do EXPECTED-RESULTS i 1- cells + @ . 1 -loop
2525
." , got "
26-
RESULTS @ 0 +do ACTUAL-RESULTS i cells + @ . loop
26+
0 RESULTS @ -do ACTUAL-RESULTS i 1- cells + @ . 1 -loop
2727
cr ;
2828
: nresults$ ." Wrong number of results, expected " depth START-DEPTH @ - .
2929
." , got " ACTUAL-DEPTH @ START-DEPTH @ - dup 0< if negate ." a " . ." cell stack underflow" else . then cr ;

0 commit comments

Comments
 (0)