sexp_processor 4.5.1 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62c0aa828d8f1248831b41b55c5e98d555f78d72
4
- data.tar.gz: 8400a9eea896d3abe596824d0d4bbd032b1aeb84
3
+ metadata.gz: f975ee007ac41fd5b43349710e01c3b76054708b
4
+ data.tar.gz: c77b1d3a11a080df070b3f987703b476603f992b
5
5
  SHA512:
6
- metadata.gz: 43948ed14ddf302790cc948f6c6587cfe8dd51a80eede842c1d3fae7305a3263fde9ee88c9bbebf3f701eed20c6c83c5ff06d7f5105156f943afa522bfe9dbee
7
- data.tar.gz: bc347b20545780e71531eb702d215a83eff13b7aeb8149e6dc62e2716db4ea8b7f16886ca6c73dcef1b773201b1e159d7f9ca0f957b9504408f7dad6ffae9e86
6
+ metadata.gz: 02edf0e83cc7752fbe124ce8e69a5b8a7199ac5fb878020d7532dd49b2d333858d044d78e92aec6d15b2429fecc3d69a6d5bb14ea18e30ad74d789eb16a44b8d
7
+ data.tar.gz: 69652aa589311f238917f6e62eb769aa19f9a8ca76df815d9cfdc53ad8d1ea79a4357fae224594f04d63bbec14697c45a8e2989e0eabaa8bcd613ac7fd96759a
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,14 @@
1
+ === 4.6.0 / 2015-05-28
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Extended generate_test to deal with 19 and up.
6
+ * Extended pt_testcase.rb so add_19tests means 19 and up.
7
+
8
+ * 1 bug fix:
9
+
10
+ * Added and normalized tests to deal with canonicalized block args from ruby_parser.
11
+
1
12
  === 4.5.1 / 2015-04-27
2
13
 
3
14
  * 1 minor enhancement:
data/lib/pt_testcase.rb CHANGED
@@ -76,7 +76,7 @@ class ParseTreeTestCase < Minitest::Test
76
76
  end
77
77
 
78
78
  def self.add_19tests name, hash
79
- add_tests "#{name}__19", hash
79
+ add_tests "#{name}__19_20_21_22", hash # HACK?
80
80
  end
81
81
 
82
82
  def self.add_19edgecases ruby, sexp, cases
@@ -101,15 +101,19 @@ class ParseTreeTestCase < Minitest::Test
101
101
  testcases[verbose][klass] = testcases[nonverbose][klass]
102
102
  end
103
103
 
104
+ VER_RE = "(1[89]|2[012])"
105
+
104
106
  def self.generate_test klass, node, data, input_name, output_name
105
107
  klass.send :define_method, "test_#{node}" do
106
108
  flunk "Processor is nil" if processor.nil?
107
109
 
108
- if node =~ /(1[89]|2[01])$/ then
109
- version = $1
110
+ tversions = node[/(?:_#{VER_RE})+$/]
111
+ if tversions then
112
+ cversion = self.class.name[/#{VER_RE}/]
113
+
110
114
  # can't push this up because it may be generating into an
111
115
  # abstract test class and the actual subclass is versioned.
112
- return "version specific test" unless self.class.name =~ /#{version}/
116
+ return "version specific test" unless tversions.include? cversion if cversion
113
117
  end
114
118
 
115
119
  assert data.has_key?(input_name), "Unknown input data"
@@ -357,12 +361,18 @@ class ParseTreeTestCase < Minitest::Test
357
361
  # 1.9 specific tests
358
362
 
359
363
  add_19edgecases("lambda { || (x + 1) }",
364
+ s(:iter,
365
+ s(:call, nil, :lambda),
366
+ s(:args),
367
+ s(:call, s(:call, nil, :x), :+, s(:lit, 1))),
368
+ "stabby_args" => "->() { (x + 1) }",
369
+ "stabby_args_doend" => "->() do (x + 1) end")
370
+
371
+ add_19edgecases("lambda { (x + 1) }",
360
372
  s(:iter,
361
373
  s(:call, nil, :lambda),
362
374
  0,
363
375
  s(:call, s(:call, nil, :x), :+, s(:lit, 1))),
364
- "stabby_args_0" => "->() { (x + 1) }",
365
- "stabby_args_0_doend" => "->() do (x + 1) end",
366
376
  "stabby_args_0_no_parens" => "-> { (x + 1) }",
367
377
  "stabby_args_0_no_parens_doend" => "-> do (x + 1) end",
368
378
  "stabby_args_0_spacebar_broken" => "->{x+1}") # I hate you
@@ -813,7 +823,7 @@ class ParseTreeTestCase < Minitest::Test
813
823
  "Ruby" => "a(b) do\n if b then\n true\n else\n c = false\n d { |x| c = true }\n c\n end\nend",
814
824
  "ParseTree" => s(:iter,
815
825
  s(:call, nil, :a, s(:call, nil, :b)),
816
- s(:args),
826
+ 0,
817
827
  s(:if,
818
828
  s(:call, nil, :b),
819
829
  s(:true),
@@ -970,14 +980,14 @@ class ParseTreeTestCase < Minitest::Test
970
980
  "Ruby" => "loop { break if true }",
971
981
  "ParseTree" => s(:iter,
972
982
  s(:call, nil, :loop),
973
- s(:args),
983
+ 0,
974
984
  s(:if, s(:true), s(:break), nil)))
975
985
 
976
986
  add_tests("break_arg",
977
987
  "Ruby" => "loop { break 42 if true }",
978
988
  "ParseTree" => s(:iter,
979
989
  s(:call, nil, :loop),
980
- s(:args),
990
+ 0,
981
991
  s(:if, s(:true), s(:break, s(:lit, 42)), nil)))
982
992
 
983
993
  add_tests("call",
@@ -1282,13 +1292,13 @@ class ParseTreeTestCase < Minitest::Test
1282
1292
  "Ruby" => "a do\n v = nil\n assert_block(full_message) do\n begin\n yield\n rescue Exception => v\n break\n end\n end\nend",
1283
1293
  "ParseTree" => s(:iter,
1284
1294
  s(:call, nil, :a),
1285
- s(:args),
1295
+ 0,
1286
1296
  s(:block,
1287
1297
  s(:lasgn, :v, s(:nil)),
1288
1298
  s(:iter,
1289
1299
  s(:call, nil, :assert_block,
1290
1300
  s(:call, nil, :full_message)),
1291
- s(:args),
1301
+ 0,
1292
1302
  s(:rescue,
1293
1303
  s(:yield),
1294
1304
  s(:resbody,
@@ -1720,7 +1730,7 @@ class ParseTreeTestCase < Minitest::Test
1720
1730
  "Ruby" => "a(:b) { :c }",
1721
1731
  "ParseTree" => s(:iter,
1722
1732
  s(:call, nil, :a, s(:lit, :b)),
1723
- s(:args),
1733
+ 0,
1724
1734
  s(:lit, :c)))
1725
1735
 
1726
1736
  add_tests("fcall_index_space",
@@ -1943,7 +1953,7 @@ class ParseTreeTestCase < Minitest::Test
1943
1953
 
1944
1954
  add_tests("iter_loop_empty",
1945
1955
  "Ruby" => "loop { }",
1946
- "ParseTree" => s(:iter, s(:call, nil, :loop), s(:args)))
1956
+ "ParseTree" => s(:iter, s(:call, nil, :loop), 0))
1947
1957
 
1948
1958
  add_tests("iter_masgn_2",
1949
1959
  "Ruby" => "a { |b, c| p(c) }",
@@ -2181,7 +2191,7 @@ class ParseTreeTestCase < Minitest::Test
2181
2191
  s(:defn, :a, s(:args),
2182
2192
  s(:iter,
2183
2193
  s(:call, nil, :c),
2184
- s(:args),
2194
+ 0,
2185
2195
  s(:rescue,
2186
2196
  s(:call, nil, :do_stuff),
2187
2197
  s(:resbody,
@@ -2394,14 +2404,14 @@ class ParseTreeTestCase < Minitest::Test
2394
2404
  "Ruby" => "loop { next if false }",
2395
2405
  "ParseTree" => s(:iter,
2396
2406
  s(:call, nil, :loop),
2397
- s(:args),
2407
+ 0,
2398
2408
  s(:if, s(:false), s(:next), nil)))
2399
2409
 
2400
2410
  add_tests("next_arg",
2401
2411
  "Ruby" => "loop { next 42 if false }",
2402
2412
  "ParseTree" => s(:iter,
2403
2413
  s(:call, nil, :loop),
2404
- s(:args),
2414
+ 0,
2405
2415
  s(:if, s(:false), s(:next, s(:lit, 42)), nil)))
2406
2416
 
2407
2417
  add_tests("nth_ref",
@@ -2551,13 +2561,13 @@ class ParseTreeTestCase < Minitest::Test
2551
2561
 
2552
2562
  add_tests("postexe",
2553
2563
  "Ruby" => "END { 1 }",
2554
- "ParseTree" => s(:iter, s(:postexe), s(:args), s(:lit, 1)))
2564
+ "ParseTree" => s(:iter, s(:postexe), 0, s(:lit, 1)))
2555
2565
 
2556
2566
  add_tests("proc_args_0",
2557
2567
  "Ruby" => "proc { || (x + 1) }",
2558
2568
  "ParseTree" => s(:iter,
2559
2569
  s(:call, nil, :proc),
2560
- 0,
2570
+ s(:args),
2561
2571
  s(:call, s(:call, nil, :x), :+, s(:lit, 1))))
2562
2572
 
2563
2573
  add_tests("proc_args_1",
@@ -2578,14 +2588,14 @@ class ParseTreeTestCase < Minitest::Test
2578
2588
  "Ruby" => "proc { (x + 1) }",
2579
2589
  "ParseTree" => s(:iter,
2580
2590
  s(:call, nil, :proc),
2581
- s(:args),
2591
+ 0,
2582
2592
  s(:call, s(:call, nil, :x), :+, s(:lit, 1))))
2583
2593
 
2584
2594
  add_tests("redo",
2585
2595
  "Ruby" => "loop { redo if false }",
2586
2596
  "ParseTree" => s(:iter,
2587
2597
  s(:call, nil, :loop),
2588
- s(:args),
2598
+ 0,
2589
2599
  s(:if, s(:false), s(:redo), nil)))
2590
2600
 
2591
2601
  add_tests("rescue", # TODO: need a resbody w/ multiple classes and a splat
@@ -33,7 +33,7 @@ require 'sexp'
33
33
 
34
34
  class SexpProcessor
35
35
 
36
- VERSION = "4.5.1"
36
+ VERSION = "4.6.0"
37
37
 
38
38
  ##
39
39
  # Automatically shifts off the Sexp type before handing the
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sexp_processor
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.1
4
+ version: 4.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  xJcC6UN6NHMOVMyAXsr2HR0gRRx4ofN1LoP2KhXzSr8UMvQYlwPmE0N5GQv1b5AO
30
30
  VpzF30vNaJK6ZT7xlIsIlwmH
31
31
  -----END CERTIFICATE-----
32
- date: 2015-04-27 00:00:00.000000000 Z
32
+ date: 2015-05-28 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: minitest
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '5.6'
40
+ version: '5.7'
41
41
  type: :development
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '5.6'
47
+ version: '5.7'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rdoc
50
50
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file