diff options
| author | LLLL Colonq <llll@colonq> | 2026-07-10 05:19:06 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-07-10 05:19:06 -0400 |
| commit | 9ba3ccd51d94e2db6920351eccb9050d1a2c41e1 (patch) | |
| tree | 95d4eb6d18147fea2890aac74f3001a9db1f8c7b /6502/test/test.fnl | |
| parent | 6f9276b24b371758bf9dbe87110843b6d6dc6f8e (diff) | |
6502: Lua bindings for testing
Diffstat (limited to '6502/test/test.fnl')
| -rw-r--r-- | 6502/test/test.fnl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/6502/test/test.fnl b/6502/test/test.fnl new file mode 100644 index 0000000..11c4f9a --- /dev/null +++ b/6502/test/test.fnl @@ -0,0 +1,20 @@ +(local json (require :json)) +(local inspect (require :inspect)) +(local l6502 (require :l6502-lua)) + +(fn slurp [path] + (let [f (io.open path)] + (f:read "*all"))) + +(local emu (l6502.new)) +(print (emu:set-pc 42)) +(print (emu:set-reg l6502.reg.SP 10)) +(print (emu:set-reg l6502.reg.A 255)) +(emu:emulate) +(print (inspect (emu:summary))) + +;; (local testcases (json.decode (slurp "testcases/6502/v1/00.json"))) +;; (each [_ test (ipairs testcases)] +;; (l6502.run test.name)) + +;; (print (inspect )) |
