Skip to content

Commit 6363093

Browse files
committed
Add CELLS test.
1 parent 1a9eff3 commit 6363093

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pkg/forth/suite_test.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,21 @@ func TestSuite(t *testing.T) {
197197
},
198198
// C,
199199
// CELL+ doesn't have regular tests
200-
// CELLS
200+
{
201+
name: "CELLS",
202+
setup: `
203+
: BITS ( X -- U )
204+
0 SWAP BEGIN DUP WHILE
205+
DUP MSB AND IF >R 1+ R> THEN 2*
206+
REPEAT DROP ;
207+
( CELLS >= 1 AU, INTEGRAL MULTIPLE OF CHAR SIZE, >= 16 BITS )
208+
`,
209+
code: `
210+
T{ 1 CELLS 1 < -> <FALSE> }T
211+
T{ 1 CELLS 1 CHARS MOD -> 0 }T
212+
T{ 1S BITS 10 < -> <FALSE> }T
213+
`,
214+
},
201215
{
202216
name: "C@", // not in test suite
203217
setup: "T{ VARIABLE c1 -> }T",

0 commit comments

Comments
 (0)