Update test_word.rb
This commit is contained in:
parent
065361bfdc
commit
9e0eca64e8
@ -26,15 +26,19 @@ module Parfait
|
|||||||
@word.set_char(1 , 32)
|
@word.set_char(1 , 32)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def test_insert
|
def test_insert_1
|
||||||
a = Parfait.new_word("abc")
|
a = Parfait.new_word("abc")
|
||||||
b = Parfait.new_word("d")
|
b = Parfait.new_word("d")
|
||||||
ans = Parfait.new_word("abcd")
|
ans = Parfait.new_word("abcd")
|
||||||
assert_equal ans, a.insert(-1,b)
|
assert_equal ans, a.insert(-1,b)
|
||||||
|
end
|
||||||
|
def test_insert_2
|
||||||
a1 = Parfait.new_word("what name")
|
a1 = Parfait.new_word("what name")
|
||||||
b1 = Parfait.new_word("is your ")
|
b1 = Parfait.new_word("is your ")
|
||||||
ans = Parfait.new_word("what is your name")
|
ans = Parfait.new_word("what is your name")
|
||||||
assert_equal ans, a1.insert(5, b1)
|
assert_equal ans, a1.insert(5, b1)
|
||||||
|
end
|
||||||
|
def test_insert_3
|
||||||
a2 = Parfait.new_word("life")
|
a2 = Parfait.new_word("life")
|
||||||
b2 = Parfait.new_word("sad ")
|
b2 = Parfait.new_word("sad ")
|
||||||
ans = Parfait.new_word("sad life")
|
ans = Parfait.new_word("sad life")
|
||||||
|
Loading…
Reference in New Issue
Block a user