Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion test/TinyRAM/Spec/EndToEndSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec = describe "TinyRAM end to end" $ do
--negative8bitTestCase
--breakWKconstraintTestCase
orTestCase
--xorTestCase
xorTestCase
addTestNegativeTestCase
--subTestCase
--notTestCase
Expand Down Expand Up @@ -535,6 +535,25 @@ orTestCase =
answer `shouldBe` Right 63

--xorTestCase
-- ; TinyRAM V=1.000 W=16 K=16
-- mov r2, 15
-- xor r1, r2, r2
-- answer r1
--should be 0

xorTestCase :: Spec
xorTestCase =
it "answers 63" $ do
let program =
construct
[ Mov (reg' 2) (imm 15),
Xor (reg' 0) (reg' 2) (reg 2),
Answer (reg 0)
]
answer <- execute program (InputTape []) (InputTape [])
answer `shouldBe` Right 63


addTestNegativeTestCase :: Spec
addTestNegativeTestCase =
it "answers 3" $ do
Expand Down