aboutsummaryrefslogtreecommitdiff
path: root/eval_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-06-09 21:55:03 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-06-09 21:55:03 +0200
commit9a859b941eb58c2fd70a8173cd260434e0fcf02f (patch)
treecb03f502c765c5ce4bdf64f74976ad55b8087036 /eval_test.go
parent6ce4ba03550593f3027955da732bd38f1644dd84 (diff)
test cases
Diffstat (limited to 'eval_test.go')
-rw-r--r--eval_test.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/eval_test.go b/eval_test.go
index c247efc..afa653f 100644
--- a/eval_test.go
+++ b/eval_test.go
@@ -71,17 +71,20 @@ func TestEval(t *testing.T) {
end: J1{pc: 2, rsp: 1, rstack: [32]uint16{0, 10}},
},
{ // r>
- // ins: []Instruction{Lit(10), Call(20), ALU{Opcode: 11, TtoN: true, TtoR: true, Ddir: 1, Rdir: -1}},
- // end: J1{pc: 21, st0: 2, rsp: 0, rstack: [32]uint16{10, 2}, dsp: 2, dstack: [32]uint16{0, 0, 10}},
+ ins: []Instruction{Lit(10), Call(20), ALU{Opcode: 11, TtoN: true, TtoR: true, Ddir: 1, Rdir: -1}},
+ end: J1{pc: 21, st0: 2, dsp: 2, dstack: [32]uint16{0, 0, 10}, rsp: 0, rstack: [32]uint16{10, 2}},
},
{ // r@
- // ALU{Opcode: 11, TtoN: true, TtoR: true, Ddir: 1}
+ ins: []Instruction{Lit(10), ALU{Opcode: 11, TtoN: true, TtoR: true, Ddir: 1}},
+ end: J1{pc: 2, dsp: 2, dstack: [32]uint16{0, 0, 10}, rstack: [32]uint16{10}},
},
{ // @
- // ALU{Opcode: 12}
+ ins: []Instruction{ALU{Opcode: 12}},
+ end: J1{pc: 1},
},
{ // !
- // ALU{Opcode: 1, NtoAtT: true, Ddir: -1}
+ ins: []Instruction{Lit(1), Lit(0), ALU{Opcode: 1, NtoAtT: true, Ddir: -1}},
+ end: J1{pc: 3, st0: 1, dsp: 1, dstack: [32]uint16{0, 0, 1}, memory: [0x8000]uint16{1}},
},
}