Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 28 lines (20 sloc) 0.526 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
require File.dirname(__FILE__) + '/helper'

class NotPredicateTest < Test::Unit::TestCase

  def test_terminal?
    rule = NotPredicate.new
    assert_equal(false, rule.terminal?)
  end

  def test_match
    rule = NotPredicate.new('a')

    match = rule.match(input('a'))
    assert_equal(nil, match)

    match = rule.match(input('b'))
    assert(match)
    assert_equal('', match.text)
    assert_equal(0, match.length)
  end

  def test_to_s
    rule = NotPredicate.new('a')
    assert_equal('!"a"', rule.to_s)
  end

end
Something went wrong with that request. Please try again.