PageRenderTime 49ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/regexp/test_arity.rb

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 17 lines | 14 code | 3 blank | 0 comment | 0 complexity | 4aeb9c56d80579c857fbc56e90a801ce MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/regexp/arity'
  2. require 'test/unit'
  3. class TestRegexpArity < Test::Unit::TestCase
  4. def test_arity
  5. r = /(1)(2)(3)/
  6. assert_equal( 3, r.arity )
  7. r = /(1)(2)(3)(4)/
  8. assert_equal( 4, r.arity )
  9. r = /(1)(2)((a)3)/
  10. assert_equal( 4, r.arity )
  11. r = /(?#nothing)(1)(2)(3)(?=3)/
  12. assert_equal( 3, r.arity )
  13. end
  14. end