Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 24 lines (20 sloc) 0.55 kB
c6d4b4b @mjackson Introduced compatibility with Ruby 1.9.2 rc2 (Thanks Simon Haydon). In
authored
1 require File.expand_path('../helper', __FILE__)
0731b28 @mjackson Added Labels. Nearing first stable release
authored
2
3 class LabelTest < Test::Unit::TestCase
7f32be2 @mjackson Eliminate Label, Predicate, and List classes.
authored
4 def test_to_s
5 rule = Rule.for('a')
6 rule.label = 'a_label'
7 assert_equal('a_label:"a"', rule.to_s)
ca9def7 @mjackson Fixed Label match naming bug
authored
8 end
9
7f32be2 @mjackson Eliminate Label, Predicate, and List classes.
authored
10 def test_to_s_sequence
11 rule = Sequence.new(%w< a b >)
12 rule.label = 's_label'
13 assert_equal('s_label:("a" "b")', rule.to_s)
14 end
0731b28 @mjackson Added Labels. Nearing first stable release
authored
15
7f32be2 @mjackson Eliminate Label, Predicate, and List classes.
authored
16 def test_to_s_embedded
17 a = Rule.for('a')
18 a.label = 'a_label'
19 rule = Sequence.new([ a, 'b' ])
20 rule.label = 's_label'
21 assert_equal('s_label:(a_label:"a" "b")', rule.to_s)
0731b28 @mjackson Added Labels. Nearing first stable release
authored
22 end
23 end
Something went wrong with that request. Please try again.