2018-04-26 11:31:37 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
2016-12-31 14:17:45 +01:00
|
|
|
module Parfait
|
2018-04-26 11:31:37 +02:00
|
|
|
class TestEmptyWord < ParfaitTest
|
2015-05-15 15:45:36 +02:00
|
|
|
|
2018-04-26 11:31:37 +02:00
|
|
|
def setup
|
2019-02-08 22:03:23 +01:00
|
|
|
Parfait.boot!(Parfait.default_test_options)
|
2018-04-26 11:31:37 +02:00
|
|
|
@word = Parfait::Word.new(0)
|
2015-05-15 15:45:36 +02:00
|
|
|
end
|
2018-04-26 11:31:37 +02:00
|
|
|
def test_word_create
|
|
|
|
assert @word.empty?
|
|
|
|
end
|
|
|
|
def test_empty_is_zero
|
|
|
|
assert_equal 0 , @word.length
|
|
|
|
end
|
|
|
|
def test_empty_is_zero_internal
|
|
|
|
assert_equal 0 , @word.char_length
|
|
|
|
end
|
|
|
|
def test_index_check_get
|
|
|
|
assert_raises RuntimeError do
|
|
|
|
@word.get_char(0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
def test_index_check_set
|
|
|
|
assert_raises RuntimeError do
|
|
|
|
@word.set_char(1 , 32)
|
|
|
|
end
|
2015-05-15 15:45:36 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|