(stdlib) Added tests
This commit is contained in:
parent
fda853b99f
commit
5a07354e04
|
@ -15,20 +15,22 @@ BRK
|
|||
|
||||
JMP2r
|
||||
|
||||
@tests
|
||||
=test-dec1
|
||||
=test-dec2
|
||||
=test-hex1
|
||||
=test-hex2
|
||||
&end
|
||||
@tests [
|
||||
=test-dec1 =test-dec2 =test-dec3 =test-dec4
|
||||
=test-hex1 =test-hex2 =test-hex3 =test-hex4
|
||||
] &end
|
||||
|
||||
(
|
||||
@|tests )
|
||||
|
||||
@test-dec1 ;dict/dec1 sdec #1234 EQU2 JMP2r
|
||||
@test-dec2 ;dict/dec2 sdec #0123 EQU2 JMP2r
|
||||
@test-hex1 ;dict/hex1 shex #12c0 EQU2 JMP2r
|
||||
@test-hex2 ;dict/hex2 shex #034f EQU2 JMP2r
|
||||
@test-dec1 ;dict/dec1 sdec #1234 EQU2 JMP2r
|
||||
@test-dec2 ;dict/dec2 sdec #0123 EQU2 JMP2r
|
||||
@test-dec3 ;dict/dec3 sdec #0000 EQU2 JMP2r
|
||||
@test-dec4 ;dict/dec4 sdec #0000 EQU2 JMP2r
|
||||
@test-hex1 ;dict/hex1 shex #12c0 EQU2 JMP2r
|
||||
@test-hex2 ;dict/hex2 shex #034f EQU2 JMP2r
|
||||
@test-hex3 ;dict/dec3 sdec #0000 EQU2 JMP2r
|
||||
@test-hex4 ;dict/dec4 sdec #0000 EQU2 JMP2r
|
||||
|
||||
(
|
||||
@|stdlib )
|
||||
|
@ -61,15 +63,20 @@ JMP2r
|
|||
|
||||
@chex ( c -- val|ff )
|
||||
|
||||
LIT "0 SUB DUP #09 GTH JMP JMP2r
|
||||
#27 SUB DUP #0f GTH JMP JMP2r
|
||||
LIT "0 SUB DUP #09 GTH [ JMP JMP2r ]
|
||||
#27 SUB DUP #0f GTH [ JMP JMP2r ]
|
||||
POP #ff
|
||||
|
||||
JMP2r
|
||||
|
||||
@dict
|
||||
@dict [
|
||||
&dec1 "4660 $1
|
||||
&dec2 "291 $1
|
||||
&dec3 "0 $1
|
||||
&dec4 "q2x*63? $1
|
||||
&hex1 "12c0 $1
|
||||
&hex2 "34f $1
|
||||
&hex3 "0 $1
|
||||
&hex4 "q2x*63? $1
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue