fix binary code mixup

mixed get_word with get_internal_word
This commit is contained in:
Torsten Ruger 2018-04-01 12:13:14 +03:00
parent 727069a306
commit 5c89884df9
2 changed files with 13 additions and 2 deletions

View File

@ -25,8 +25,8 @@ module Parfait
end end
def each_word def each_word
index = 1 index = 1
while( index < 14) while( index <= data_length)
yield get_internal_word(index) yield get_word(index)
index += 1 index += 1
end end
end end

View File

@ -74,5 +74,16 @@ module Parfait
@code.each_word{ len += 1} @code.each_word{ len += 1}
assert_equal 13 , len assert_equal 13 , len
end end
def test_set_word
assert_equal 1 , @code.set_word(1 , 1)
end
def test_get_word
@code.set_word(1 , 1)
assert_equal 1, @code.get_word(1)
end
def test_get_internal_word
@code.set_word(1 , 1)
assert_equal 1, @code.get_internal_word(@code.data_start + 1)
end
end end
end end