mirror of https://github.com/mgcaret/of816.git
increase test coverage, now 84% of system words
This commit is contained in:
parent
9778c198e8
commit
e789327c87
|
@ -0,0 +1,6 @@
|
||||||
|
testing 5.3.2 Forth FCode Functions
|
||||||
|
|
||||||
|
\ This only tests functions not covered in the 7.3.x tests
|
||||||
|
|
||||||
|
|
||||||
|
t{ (cr -> }t
|
|
@ -0,0 +1,34 @@
|
||||||
|
testing 5.3.3 FCode implementation functions
|
||||||
|
|
||||||
|
\ Only testing built-in functions, it is expected that
|
||||||
|
\ the remaining Open Firmware specification, if implemented
|
||||||
|
\ will be done in Forth source or FCode.
|
||||||
|
|
||||||
|
\ Also, OF816 doesn't implement some of the FCode functions
|
||||||
|
\ as visible words (e.g. new-token, etc.)
|
||||||
|
\ These are untested by this suite.
|
||||||
|
|
||||||
|
testing 5.3.3.1 Defining new FCode functions
|
||||||
|
|
||||||
|
t{ s" mytrue" ' true (is-user-word) -> }t
|
||||||
|
t{ fc get-token drop -> ' ferror }t
|
||||||
|
|
||||||
|
600 get-token 2constant old-600
|
||||||
|
t{ ' true false 600 set-token -> }t
|
||||||
|
t{ 600 get-token -> ' true false }t
|
||||||
|
t{ ' false true 600 set-token -> }t
|
||||||
|
t{ 600 get-token -> ' false true }t
|
||||||
|
t{ old-600 600 set-token -> }t
|
||||||
|
t{ old-600 600 get-token swap >r = r> rot = -> true true }t
|
||||||
|
|
||||||
|
testing 5.3.3.3 Controlling values and defers
|
||||||
|
|
||||||
|
\ BEHAVIOR tested elsewhere, but we'll test here to verify
|
||||||
|
\ (is-user-word)
|
||||||
|
|
||||||
|
t{ ' mytrue behavior -> ' true }t
|
||||||
|
|
||||||
|
testing OF816 5.3.3-related checks
|
||||||
|
|
||||||
|
\ 0 and ff fcodes should be equivalent
|
||||||
|
t{ 0 get-token ff get-token swap >r = r> rot = -> true true }t
|
|
@ -0,0 +1,12 @@
|
||||||
|
testing 5.3.7.6 Start and end
|
||||||
|
|
||||||
|
hex
|
||||||
|
|
||||||
|
\ ferror token validated in 5.3.3.x, now let's test
|
||||||
|
t{ ' ferror catch >r clear r> 0= -> false }t
|
||||||
|
|
||||||
|
\ Fcode: version1 true end0
|
||||||
|
: test-fcode " "(fd 08 00 a4 00 00 00 0a a4 00)" ;
|
||||||
|
|
||||||
|
\ covers: $byte-exec
|
||||||
|
t{ test-fcode drop 1 byte-load -> true }t
|
|
@ -61,8 +61,10 @@ t{ ' exit? 0= -> false }t
|
||||||
|
|
||||||
testing 7.3.4.7 String literals
|
testing 7.3.4.7 String literals
|
||||||
|
|
||||||
|
\ covers: "
|
||||||
t{ " test" swap 0> -> 4 true }t
|
t{ " test" swap 0> -> 4 true }t
|
||||||
t{ s" test" swap 0> -> 4 true }t
|
t{ s" test" swap 0> -> 4 true }t
|
||||||
|
\ covers: "
|
||||||
t{ " test"(41)" swap 0> -> 5 true }t
|
t{ " test"(41)" swap 0> -> 5 true }t
|
||||||
t{ s" testA" drop " test"(41)" comp -> 0 }t
|
t{ s" testA" drop " test"(41)" comp -> 0 }t
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,15 @@
|
||||||
testing Dictionary
|
testing 7.5.3 Dictionary
|
||||||
|
|
||||||
|
testing 7.5.3.1 Dictionary search
|
||||||
|
|
||||||
|
\ not implemented: .calls $sift sifting
|
||||||
|
|
||||||
t{ ' words 0= -> false }t
|
t{ ' words 0= -> false }t
|
||||||
|
|
||||||
|
testing 7.5.3.2 Decompiler
|
||||||
|
|
||||||
|
\ Hard to test properly
|
||||||
|
|
||||||
|
t{ ' see 0= -> false }t
|
||||||
|
t{ ' (see) 0= -> false }t
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
\ To be tokenized with toke and embedded in the 5.3.7.6 test
|
||||||
|
version1 true end0
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,14 @@
|
||||||
load:
|
load:
|
||||||
- tester.fs
|
- tester.fs
|
||||||
- 7.5.3.fs
|
- 7.5.3.fs
|
||||||
|
- name: 5.3.2 Forth FCode Functions
|
||||||
|
load:
|
||||||
|
- tester.fs
|
||||||
|
- 5.3.2.fs
|
||||||
|
- name: 5.3.3 FCode implementation functions
|
||||||
|
load:
|
||||||
|
- tester.fs
|
||||||
|
- 5.3.3.fs
|
||||||
- name: 5.3.4.3 Get local arguments
|
- name: 5.3.4.3 Get local arguments
|
||||||
load:
|
load:
|
||||||
- tester.fs
|
- tester.fs
|
||||||
|
@ -85,6 +93,11 @@
|
||||||
load:
|
load:
|
||||||
- tester.fs
|
- tester.fs
|
||||||
- 5.3.7.4.fs
|
- 5.3.7.4.fs
|
||||||
|
- name: 5.3.7.6 Start and end
|
||||||
|
load:
|
||||||
|
- tester.fs
|
||||||
|
- 5.3.7.6.fs
|
||||||
|
|
||||||
- name: OF816 Words
|
- name: OF816 Words
|
||||||
load:
|
load:
|
||||||
- tester.fs
|
- tester.fs
|
||||||
|
|
Loading…
Reference in New Issue