Sha256: 84a6ae1f6e63229d326b3f23eccf9d90dc474990dc3964ed31e1b0acd8fd00d1

Contents?: true

Size: 588 Bytes

Versions: 16

Compression:

Stored size: 588 Bytes

Contents

require 'facets/matchdata/matchset'
require 'test/unit'

class Test_MatchData_Matchset < Test::Unit::TestCase

  def test_matchtree_01
    md = /(bb)(cc(dd))(ee)/.match "XXaabbccddeeffXX"
    assert_equal( [["bb"], ["cc", ["dd"]], ["ee"]] , md.matchtree )
  end

  def test_matchtree_02
    md = /(bb)c(c(dd))(ee)/.match "XXaabbccddeeffXX"
    assert_equal( [["bb"], "c", ["c", ["dd"]], ["ee"]] , md.matchtree )
  end

  def test_matchset
    md = /(bb)(cc(dd))(ee)/.match "XXaabbccddeeffXX"
    assert_equal( ["XXaa", [["bb"], ["cc", ["dd"]], ["ee"]], "ffXX"] , md.matchset )
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/matchdata/test_matchset.rb
facets-2.8.3 test/core/matchdata/test_matchset.rb
facets-2.8.2 test/core/matchdata/test_matchset.rb
facets-2.8.1 test/core/matchdata/test_matchset.rb
facets-2.8.0 test/core/matchdata/test_matchset.rb
facets-2.7.0 test/core/matchdata/test_matchset.rb
facets-2.6.0 test/core/matchdata/test_matchset.rb
facets-2.4.0 test/matchdata/test_matchset.rb
facets-2.4.1 test/matchdata/test_matchset.rb
facets-2.4.4 test/core/matchdata/test_matchset.rb
facets-2.4.3 test/core/matchdata/test_matchset.rb
facets-2.4.2 test/core/matchdata/test_matchset.rb
facets-2.5.1 test/core/matchdata/test_matchset.rb
facets-2.5.0 test/core/matchdata/test_matchset.rb
facets-2.4.5 test/core/matchdata/test_matchset.rb
facets-2.5.2 test/core/matchdata/test_matchset.rb