sexp_processor 4.2.1 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +3 -2
- data/History.txt +6 -0
- data/lib/pt_testcase.rb +6 -1
- data/lib/sexp_processor.rb +1 -1
- data/test/test_composite_sexp_processor.rb +2 -1
- data/test/test_environment.rb +1 -1
- data/test/test_sexp.rb +32 -28
- data/test/test_sexp_processor.rb +13 -13
- metadata +14 -14
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
9.���\���@'�.��H[��LB>�baݙF�ŧ�BE�aҋg����U�����y�-�!��
|
2
|
+
�/�9�!�
|
3
|
+
�%�a8��2ˎL.�F�Bm��U,,3P�
|
data/History.txt
CHANGED
data/lib/pt_testcase.rb
CHANGED
@@ -32,7 +32,7 @@ class Examples
|
|
32
32
|
RUBY_VERSION < "1.9"
|
33
33
|
end
|
34
34
|
|
35
|
-
class ParseTreeTestCase <
|
35
|
+
class ParseTreeTestCase < Minitest::Test
|
36
36
|
attr_accessor :processor # to be defined by subclass
|
37
37
|
|
38
38
|
def setup
|
@@ -2684,6 +2684,11 @@ class ParseTreeTestCase < MiniTest::Unit::TestCase
|
|
2684
2684
|
"Ruby" => "class << self\n 42\nend",
|
2685
2685
|
"ParseTree" => s(:sclass, s(:self), s(:lit, 42)))
|
2686
2686
|
|
2687
|
+
add_tests("sclass_multiple",
|
2688
|
+
"Ruby" => "class << self\n x\n y\nend",
|
2689
|
+
"ParseTree" => s(:sclass, s(:self),
|
2690
|
+
s(:call, nil, :x), s(:call, nil, :y)))
|
2691
|
+
|
2687
2692
|
add_tests("sclass_trailing_class",
|
2688
2693
|
"Ruby" => "class A\n class << self\n a\n end\n \n class B\n end\nend",
|
2689
2694
|
"ParseTree" => s(:class, :A, nil,
|
data/lib/sexp_processor.rb
CHANGED
@@ -24,7 +24,7 @@ class FakeProcessor1 < SexpProcessor # ZenTest SKIP
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
class TestCompositeSexpProcessor <
|
27
|
+
class TestCompositeSexpProcessor < Minitest::Test
|
28
28
|
|
29
29
|
def setup
|
30
30
|
@p = CompositeSexpProcessor.new
|
@@ -53,6 +53,7 @@ class TestCompositeSexpProcessor < MiniTest::Unit::TestCase
|
|
53
53
|
|
54
54
|
def test_processors
|
55
55
|
# everything is tested by test_append
|
56
|
+
skip
|
56
57
|
end
|
57
58
|
|
58
59
|
def test_append
|
data/test/test_environment.rb
CHANGED
data/test/test_sexp.rb
CHANGED
@@ -7,7 +7,7 @@ require 'sexp_processor'
|
|
7
7
|
require 'stringio'
|
8
8
|
require 'pp'
|
9
9
|
|
10
|
-
class SexpTestCase <
|
10
|
+
class SexpTestCase < Minitest::Test
|
11
11
|
# KEY for regex tests
|
12
12
|
# :a == no change
|
13
13
|
# :b == will change (but sometimes ONLY once)
|
@@ -28,10 +28,6 @@ class SexpTestCase < MiniTest::Unit::TestCase
|
|
28
28
|
def setup
|
29
29
|
@any = ANY()
|
30
30
|
end
|
31
|
-
|
32
|
-
def test_stupid
|
33
|
-
# shuts up test/unit
|
34
|
-
end
|
35
31
|
end
|
36
32
|
|
37
33
|
class TestSexp < SexpTestCase # ZenTest FULL
|
@@ -61,11 +57,11 @@ class TestSexp < SexpTestCase # ZenTest FULL
|
|
61
57
|
end
|
62
58
|
|
63
59
|
def test_class_from_array
|
64
|
-
|
60
|
+
skip 'Need to write test_class_from_array'
|
65
61
|
end
|
66
62
|
|
67
63
|
def test_class_index
|
68
|
-
|
64
|
+
skip 'Need to write test_class_index'
|
69
65
|
end
|
70
66
|
|
71
67
|
def test_array_type_eh
|
@@ -101,7 +97,9 @@ class TestSexp < SexpTestCase # ZenTest FULL
|
|
101
97
|
|
102
98
|
def test_equals2_sexp
|
103
99
|
sexp2 = s(1, 2, 3)
|
104
|
-
|
100
|
+
if @sexp.class == Sexp then
|
101
|
+
skip "Not applicable to this target."
|
102
|
+
else
|
105
103
|
refute_equal(@sexp, sexp2)
|
106
104
|
end
|
107
105
|
end
|
@@ -167,15 +165,20 @@ class TestSexp < SexpTestCase # ZenTest FULL
|
|
167
165
|
end
|
168
166
|
|
169
167
|
def test_gsub
|
170
|
-
assert_equal s(:c),
|
171
|
-
assert_equal s(:
|
172
|
-
assert_equal s(:a), s(:a).gsub(s(:b), s(:c))
|
168
|
+
assert_equal s(:c), s(:b). gsub(s(:b), s(:c))
|
169
|
+
assert_equal s(:a), s(:a). gsub(s(:b), s(:c))
|
173
170
|
assert_equal s(:a, s(:c)), s(:a, s(:b)).gsub(s(:b), s(:c))
|
171
|
+
end
|
172
|
+
|
173
|
+
def test_gsub_empty
|
174
|
+
assert_equal s(:c), s().gsub(s(), s(:c))
|
175
|
+
end
|
174
176
|
|
177
|
+
def test_gsub_multiple
|
175
178
|
assert_equal(s(:a, s(:c), s(:c)),
|
176
|
-
s(:a, s(:b), s(:b)).gsub(s(:b), s(:c)))
|
179
|
+
s(:a, s(:b), s(:b)). gsub(s(:b), s(:c)))
|
177
180
|
assert_equal(s(:a, s(:c), s(:a, s(:c))),
|
178
|
-
s(:a, s(:b), s(:a, s(:b))).gsub(s(:b), s(:c)))
|
181
|
+
s(:a, s(:b), s(:a, s(:b))). gsub(s(:b), s(:c)))
|
179
182
|
end
|
180
183
|
|
181
184
|
def test_inspect
|
@@ -284,21 +287,22 @@ class TestSexp < SexpTestCase # ZenTest FULL
|
|
284
287
|
end
|
285
288
|
|
286
289
|
def test_sub
|
287
|
-
assert_equal s(:c),
|
288
|
-
assert_equal s(:c), s(:b).sub(s(:b), s(:c))
|
289
|
-
assert_equal s(:a), s(:a).sub(s(:b), s(:c))
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
assert_equal(s(:a, s(:c), s(:
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
assert_equal
|
299
|
-
|
300
|
-
|
301
|
-
|
290
|
+
assert_equal s(:c), s(:b). sub(s(:b), s(:c))
|
291
|
+
assert_equal s(:a, s(:c), s(:b)), s(:a, s(:b), s(:b)). sub(s(:b), s(:c))
|
292
|
+
assert_equal s(:a, s(:c), s(:a)), s(:a, s(:b), s(:a)). sub(s(:b), s(:c))
|
293
|
+
end
|
294
|
+
|
295
|
+
def test_sub_miss
|
296
|
+
assert_equal s(:a), s(:a). sub(s(:b), s(:c))
|
297
|
+
assert_equal s(:a, s(:c)), s(:a, s(:c)). sub(s(:b), s(:c))
|
298
|
+
end
|
299
|
+
|
300
|
+
def test_sub_empty
|
301
|
+
assert_equal s(:c), s(). sub(s(), s(:c))
|
302
|
+
end
|
303
|
+
|
304
|
+
def test_sub_structure
|
305
|
+
assert_equal(s(:a, s(:c, s(:b))), s(:a, s(:b)). sub(s(:b), s(:c, s(:b))))
|
302
306
|
end
|
303
307
|
|
304
308
|
def test_to_a
|
data/test/test_sexp_processor.rb
CHANGED
@@ -93,7 +93,7 @@ end
|
|
93
93
|
|
94
94
|
# Real test classes:
|
95
95
|
|
96
|
-
class TestSexpProcessor <
|
96
|
+
class TestSexpProcessor < Minitest::Test
|
97
97
|
|
98
98
|
def setup
|
99
99
|
@processor = TestProcessor.new
|
@@ -151,12 +151,12 @@ class TestSexpProcessor < MiniTest::Unit::TestCase
|
|
151
151
|
@processor.process([:blah, 1, 2, 3])
|
152
152
|
end
|
153
153
|
end
|
154
|
-
def test_strict=; end #Handled
|
154
|
+
def test_strict=; skip; end #Handled
|
155
155
|
|
156
156
|
def test_require_empty_false
|
157
157
|
@processor.require_empty = false
|
158
158
|
|
159
|
-
@processor.process([:nonempty, 1, 2, 3])
|
159
|
+
assert_equal s(:nonempty, 1, 2, 3), @processor.process([:nonempty, 1, 2, 3])
|
160
160
|
end
|
161
161
|
|
162
162
|
def test_require_empty_true
|
@@ -164,7 +164,7 @@ class TestSexpProcessor < MiniTest::Unit::TestCase
|
|
164
164
|
@processor.process([:nonempty, 1, 2, 3])
|
165
165
|
end
|
166
166
|
end
|
167
|
-
def test_require_empty=; end # handled
|
167
|
+
def test_require_empty=; skip; end # handled
|
168
168
|
|
169
169
|
def test_process_strip
|
170
170
|
@processor.auto_shift_type = true
|
@@ -239,7 +239,7 @@ class TestSexpProcessor < MiniTest::Unit::TestCase
|
|
239
239
|
end
|
240
240
|
|
241
241
|
def test_assert_type_hit
|
242
|
-
@processor.assert_type([:blah, 1, 2, 3], :blah)
|
242
|
+
assert_nil @processor.assert_type([:blah, 1, 2, 3], :blah)
|
243
243
|
end
|
244
244
|
|
245
245
|
def test_assert_type_miss
|
@@ -249,7 +249,7 @@ class TestSexpProcessor < MiniTest::Unit::TestCase
|
|
249
249
|
end
|
250
250
|
|
251
251
|
def test_generate
|
252
|
-
|
252
|
+
skip "nothing to test at this time... soon."
|
253
253
|
end
|
254
254
|
|
255
255
|
def test_auto_shift_type
|
@@ -258,7 +258,7 @@ class TestSexpProcessor < MiniTest::Unit::TestCase
|
|
258
258
|
@processor.auto_shift_type = true
|
259
259
|
assert_equal(true, @processor.auto_shift_type)
|
260
260
|
end
|
261
|
-
def test_auto_shift_type_equal; end # handled
|
261
|
+
def test_auto_shift_type_equal; skip; end # handled
|
262
262
|
|
263
263
|
def test_default_method
|
264
264
|
# default functionality tested in process_default
|
@@ -266,7 +266,7 @@ class TestSexpProcessor < MiniTest::Unit::TestCase
|
|
266
266
|
@processor.default_method = :something
|
267
267
|
assert_equal :something, @processor.default_method
|
268
268
|
end
|
269
|
-
def test_default_method=; end # handled
|
269
|
+
def test_default_method=; skip; end # handled
|
270
270
|
|
271
271
|
def test_expected
|
272
272
|
assert_equal Sexp, @processor.expected
|
@@ -286,12 +286,12 @@ class TestSexpProcessor < MiniTest::Unit::TestCase
|
|
286
286
|
|
287
287
|
@processor.process([:expected]) # shouldn't raise
|
288
288
|
end
|
289
|
-
def test_expected=; end # handled
|
289
|
+
def test_expected=; skip; end # handled
|
290
290
|
|
291
291
|
# Not Testing:
|
292
|
-
def test_debug; end
|
293
|
-
def test_debug=; end
|
294
|
-
def test_warn_on_default; end
|
295
|
-
def test_warn_on_default=; end
|
292
|
+
def test_debug; skip; end
|
293
|
+
def test_debug=; skip; end
|
294
|
+
def test_warn_on_default; skip; end
|
295
|
+
def test_warn_on_default=; skip; end
|
296
296
|
|
297
297
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sexp_processor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 4.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 4.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2013-
|
39
|
+
date: 2013-08-19 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
@@ -46,11 +46,11 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ~>
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
hash:
|
49
|
+
hash: 31
|
50
50
|
segments:
|
51
|
-
-
|
52
|
-
-
|
53
|
-
version: "
|
51
|
+
- 5
|
52
|
+
- 0
|
53
|
+
version: "5.0"
|
54
54
|
type: :development
|
55
55
|
version_requirements: *id001
|
56
56
|
- !ruby/object:Gem::Dependency
|
@@ -76,11 +76,11 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - ~>
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
hash:
|
79
|
+
hash: 9
|
80
80
|
segments:
|
81
81
|
- 3
|
82
|
-
-
|
83
|
-
version: "3.
|
82
|
+
- 7
|
83
|
+
version: "3.7"
|
84
84
|
type: :development
|
85
85
|
version_requirements: *id003
|
86
86
|
description: |-
|
@@ -113,8 +113,8 @@ files:
|
|
113
113
|
- test/test_sexp_processor.rb
|
114
114
|
- .gemtest
|
115
115
|
homepage: https://github.com/seattlerb/sexp_processor
|
116
|
-
licenses:
|
117
|
-
|
116
|
+
licenses:
|
117
|
+
- MIT
|
118
118
|
post_install_message:
|
119
119
|
rdoc_options:
|
120
120
|
- --main
|
metadata.gz.sig
CHANGED
Binary file
|