require 'test/unit' require 'rockit/grammar' include Rockit class UTestRepetitionOperator < Test::Unit::TestCase def test_01_creation_of_repetition r = Repetition.new(:A, 2, 10) assert_kind_of(Repetition, r) assert_kind_of(Operator, r) assert_kind_of(GrammarSymbol, r) assert_equal(2, r.min) assert_equal(10, r.max) end def test_02_creation_of_mult r = Mult.new(:C) assert_kind_of(Mult, r) assert_kind_of(Repetition, r) assert_kind_of(Operator, r) assert_kind_of(GrammarSymbol, r) assert_equal(0, r.min) assert_equal((1.0/0.0), r.max) end def test_03_creation_of_plus r = Plus.new(:C) assert_kind_of(Plus, r) assert_kind_of(Repetition, r) assert_kind_of(Operator, r) assert_kind_of(GrammarSymbol, r) assert_equal(1, r.min) assert_equal((1.0/0.0), r.max) end end