2017-01-01 20:51:23 +01:00
|
|
|
require_relative "../helper"
|
|
|
|
|
2017-01-19 08:02:29 +01:00
|
|
|
module Risc
|
2017-01-01 20:51:23 +01:00
|
|
|
class TestAssembler < MiniTest::Test
|
|
|
|
|
|
|
|
def setup
|
2017-01-19 08:02:29 +01:00
|
|
|
@machine = Risc.machine.boot
|
2017-01-01 20:51:23 +01:00
|
|
|
end
|
2018-03-29 11:16:27 +02:00
|
|
|
def est_init
|
|
|
|
@assembler = Assembler.new(@machine)
|
2017-01-01 20:51:23 +01:00
|
|
|
end
|
2018-03-29 11:16:27 +02:00
|
|
|
def est_write_fails
|
|
|
|
@assembler = Assembler.new(@machine)
|
2018-03-25 19:02:51 +02:00
|
|
|
assert_raises{ @assembler.write_as_string} #must translate first
|
2017-01-01 20:51:23 +01:00
|
|
|
end
|
2018-03-26 12:43:26 +02:00
|
|
|
def test_write_space
|
2018-03-27 19:47:41 +02:00
|
|
|
assert @machine.position_all
|
2018-03-29 11:16:27 +02:00
|
|
|
@assembler = Assembler.new(@machine)
|
|
|
|
assert @assembler.write_as_string
|
2017-01-01 20:51:23 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|