rubyx/test/parfait/test_word.rb

31 lines
634 B
Ruby
Raw Normal View History

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
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)
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
end
end
end