rubyx/test/mom/test_instruction.rb
Torsten Rüger 5a43cbff15 Fixing tests for implicit return
previous commit affected rather many test, as the implicit returns add extra instructions
Also added some explicit returns, so as not to test the return logic too much. return (ie return nl) is a knonwn 3 risc operation.
2019-08-17 23:29:42 +03:00

21 lines
391 B
Ruby

require_relative "helper"
module Mom
class TestInstruction < MiniTest::Test
def test_instantiates
assert Instruction.new("Hi")
end
def test_string_source
assert_equal "Hi" ,Instruction.new("Hi").source
end
def test_nil_next
assert_nil Instruction.new("Hi").next
end
def test_raise
assert_raises {Instruction.new(5)}
end
end
end