random checkin

still suffering -1 trauma
This commit is contained in:
Torsten Ruger
2018-05-14 12:38:44 +03:00
parent ab01fa3862
commit 4a88f342d3
18 changed files with 45 additions and 44 deletions

View File

@ -25,7 +25,7 @@ module Risc
def test_load_args_from_message
produced = produce_body
assert_equal :r0 , produced.next.array.symbol , produced.next.to_rxf
assert_equal 9 , produced.next.index , produced.next.to_rxf
assert_equal 8 , produced.next.index , produced.next.to_rxf
end
end

View File

@ -21,12 +21,12 @@ module Risc
def test_frame_load
produced = produce_body
assert_equal :Message , produced.next(1).array.type
assert_equal 4 , produced.next(1).index # 4 is frame
assert_equal 3 , produced.next(1).index # 3 is frame
end
def test_value_load
produced = produce_body
assert_equal produced.next(2).register , produced.register
assert_equal 2 , produced.next(2).index #type == 1 , r == 2
assert_equal 1 , produced.next(2).index #type == 0 , r == 1
end
end

View File

@ -21,12 +21,12 @@ module Risc
def test_frame_load
produced = produce_body
assert_equal :Message , produced.next(1).array.type
assert_equal 4 , produced.next(1).index # 4 is frame
assert_equal 3 , produced.next(1).index # 4 is frame
end
def test_value_load
produced = produce_body
assert_equal produced.next(2).register , produced.register
assert_equal 2 , produced.next(2).index #type == 1 , r == 2
assert_equal 1 , produced.next(2).index #type == 1 , r == 2
end
end

View File

@ -53,7 +53,7 @@ module Parfait
end
def test_nilled
assert_equal 0 , @code.get_word(1)
assert_equal 0 , @code.get_word(14)
assert_equal 0 , @code.get_word(13)
end
def test_get_set_self
@code.set_word(10,1)
@ -86,11 +86,11 @@ module Parfait
assert_equal 13 , len
end
def test_each_set
(1..13).each{|i| @code.set_word(i,i)}
(0..12).each{|i| @code.set_word(i,i)}
all = []
@code.each_word{ |w| all << w}
assert_equal 1 , all.first
assert_equal 13 , all.last
assert_equal 0 , all.first
assert_equal 12 , all.last
end
def test_set_word
assert_equal 1 , @code.set_word(1 , 1)

View File

@ -180,5 +180,10 @@ module Parfait
end
assert_equal 2 , counter
end
def test_to_a
arr = @list.to_a
assert_equal Array , arr.class
assert_equal 3 , arr.length
end
end
end