insertion pushes, split position tests
This commit is contained in:
36
test/risc/position/test_position2.rb
Normal file
36
test/risc/position/test_position2.rb
Normal file
@ -0,0 +1,36 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Risc
|
||||
class TestPositionMath < MiniTest::Test
|
||||
|
||||
def setup
|
||||
@pos = Position.new(self , 5)
|
||||
end
|
||||
def test_add
|
||||
res = @pos + 5
|
||||
assert_equal 10 , res
|
||||
end
|
||||
def test_sub
|
||||
res = @pos - 3
|
||||
assert_equal 2 , res
|
||||
end
|
||||
def test_sub_pos
|
||||
res = @pos - Position.new(@pos,4)
|
||||
assert_equal 1 , res
|
||||
end
|
||||
def test_lg
|
||||
assert @pos > Position.new(@pos,4)
|
||||
end
|
||||
def test_tos
|
||||
assert_equal "0x5" , @pos.to_s
|
||||
end
|
||||
def test_reset_ok
|
||||
pos = @pos.set(10)
|
||||
assert_equal 10 , pos
|
||||
end
|
||||
def test_at
|
||||
pos = Position.at(5)
|
||||
assert_equal 5 , pos.at
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user