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