2015-10-27 17:08:40 +01:00
|
|
|
require_relative "../helper"
|
|
|
|
|
|
|
|
class TestMessage < MiniTest::Test
|
|
|
|
|
|
|
|
def setup
|
2017-01-19 08:02:29 +01:00
|
|
|
Risc.machine.boot
|
2016-12-30 13:10:49 +01:00
|
|
|
@space = Parfait.object_space
|
2016-12-30 13:04:59 +01:00
|
|
|
@mess = @space.first_message
|
2015-10-27 17:08:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_length
|
2016-02-25 20:50:10 +01:00
|
|
|
assert_equal 9 , @mess.get_type.instance_length , @mess.get_type.inspect
|
2015-10-27 17:08:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_attribute_set
|
2016-12-29 17:45:32 +01:00
|
|
|
@mess.set_receiver( 55)
|
2015-10-27 17:08:40 +01:00
|
|
|
assert_equal 55 , @mess.receiver
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_indexed
|
2016-12-21 21:35:36 +01:00
|
|
|
assert_equal 9 , @mess.get_type.variable_index(:arguments)
|
2015-10-27 17:08:40 +01:00
|
|
|
end
|
|
|
|
|
2016-12-29 17:45:32 +01:00
|
|
|
def test_next
|
|
|
|
assert @mess.next_message
|
|
|
|
end
|
2015-10-27 17:08:40 +01:00
|
|
|
end
|