File: test_branch.rb

package info (click to toggle)
ruby-rsec 0.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 272 kB
  • sloc: ruby: 2,130; lisp: 13; makefile: 3
file content (14 lines) | stat: -rw-r--r-- 301 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require "#{File.dirname(__FILE__)}/helpers.rb"

class TestBranch < TC
  def test_branch
    p = 'a'.r | /\d+/ | seq('c', 'd')
    ase ['c','d'], p.parse('cd')
    ase '3', p.parse('3')
    ase INVALID, p.parse('c')

    p = 'x'.r | 'y'
    ase INVALID, p.parse('')
    ase 'y', p.parse('y')
  end
end