diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2014-11-28 18:12:15 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2014-11-28 18:12:15 -0800 |
commit | e148b2943d5887023b5da80a2503fd4eb9a939a4 (patch) | |
tree | 2e3a784c96757605ea59038a818345ecd74f5381 | |
parent | 701144ace12d8fa621c900c16c725da170494c77 (diff) | |
download | mu-e148b2943d5887023b5da80a2503fd4eb9a939a4.tar.gz |
367 - start of unit tests for 'm'
-rw-r--r-- | mu.arc.t | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t index a7175d77..e0dc8b4d 100644 --- a/mu.arc.t +++ b/mu.arc.t @@ -809,6 +809,21 @@ (if (~is 35 (sizeof '(4 integer-array))) (prn "F - 'sizeof' reads array lengths from memory using default-scope")) +; unit tests for 'm' helper +(reset) +(if (~is 4 (m '(4 literal))) + (prn "F - 'm' avoids reading memory for literals")) +(if (~is 4 (m '(4 offset))) + (prn "F - 'm' avoids reading memory for offsets")) +(= memory*.4 34) +(if (~is 34 (m '(4 integer))) + (prn "F - 'm' reads memory for simple types")) +(= memory*.3 4) +(if (~is 34 (m '(3 integer-address deref))) + (prn "F - 'm' redirects addresses")) +(if (~iso (annotate 'record '(34 nil)) (m '(4 integer-boolean-pair))) + (prn "F - 'm' supports compound records")) + (reset) (new-trace "copy-record") (add-code |