Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated heckle for latest PT (unified) changes.

[git-p4: depot-paths = "//src/heckle/dev/": change = 4120]
  • Loading branch information...
commit fb83c6a0e9632080717e9a21966811ac4b17c338 1 parent c6f379e
@zenspider zenspider authored
Showing with 7 additions and 101 deletions.
  1. +3 −1 .autotest
  2. +4 −100 test/test_heckle.rb
View
4 .autotest
@@ -1,5 +1,7 @@
# -*- ruby -*-
Autotest.add_hook :initialize do |at|
- at.extra_class_map["TestHeckleIter"] = "test/test_heckle.rb"
+ %w(TestHeckleDasgn TestHeckleIter TestHeckleDasgncurr).each do |klass|
+ at.extra_class_map[klass] = "test/test_heckle.rb"
+ end
end
View
104 test/test_heckle.rb
@@ -560,102 +560,6 @@ def test_cvasgn_nil
end
-class TestHeckleDasgn < HeckleTestCase
-
- def setup
- @nodes = s(:dasgn)
- super
- end
-
- def test_dasgn_val
- expected = s(:defn, :uses_dasgn,
- s(:args),
- s(:scope,
- s(:block,
- s(:iter,
- s(:call, nil, :loop, s(:arglist)),
- s(:dasgn_curr, :dvar),
- s(:iter,
- s(:call, nil, :loop, s(:arglist)),
- nil,
- s(:block,
- s(:dasgn, :dvar, s(:nil)),
- s(:dasgn, :dvar, s(:nil))))))))
-
- @heckler.process(@heckler.current_tree)
- assert_equal expected, @heckler.current_tree
- end
-
- def test_dasgn_nil
- expected = s(:defn, :uses_dasgn,
- s(:args),
- s(:scope,
- s(:block,
- s(:iter,
- s(:call, nil, :loop, s(:arglist)),
- s(:dasgn_curr, :dvar),
- s(:iter,
- s(:call, nil, :loop, s(:arglist)),
- nil,
- s(:block,
- s(:dasgn, :dvar, s(:lit, 5)),
- s(:dasgn, :dvar, s(:lit, 42))))))))
-
- @heckler.process(@heckler.current_tree)
- @heckler.reset_tree
- @heckler.process(@heckler.current_tree)
- assert_equal expected, @heckler.current_tree
- end
-
-end
-
-class TestHeckleDasgncurr < HeckleTestCase
-
- def setup
- @nodes = s(:dasgn_curr)
- super
- end
-
- def test_dasgn_curr_val
- expected = s(:defn, :uses_dasgncurr,
- s(:args),
- s(:scope,
- s(:block,
- s(:iter,
- s(:call, nil, :loop, s(:arglist)),
- s(:dasgn_curr, :dvar),
- s(:block,
- s(:dasgn_curr, :dvar, s(:nil)),
- s(:dasgn_curr, :dvar, s(:nil)))))))
-
- @heckler.process(@heckler.current_tree)
- @heckler.reset_tree
- @heckler.process(@heckler.current_tree)
- assert_equal expected, @heckler.current_tree
- end
-
- def test_dasgn_curr_nil
- expected = s(:defn, :uses_dasgncurr,
- s(:args),
- s(:scope,
- s(:block,
- s(:iter,
- s(:call, nil, :loop, s(:arglist)),
- s(:dasgn_curr, :dvar),
- s(:block,
- s(:dasgn_curr, :dvar, s(:lit, 5)),
- s(:dasgn_curr, :dvar, s(:lit, 42)))))))
-
- @heckler.process(@heckler.current_tree)
- @heckler.reset_tree
- @heckler.process(@heckler.current_tree)
- @heckler.reset_tree
- @heckler.process(@heckler.current_tree)
- assert_equal expected, @heckler.current_tree
- end
-
-end
-
class TestHeckleIasgn < HeckleTestCase
def setup
@@ -800,8 +704,8 @@ def test_iter
s(:lasgn, :x, s(:nil)),
s(:iter,
s(:call, s(:lvar, :x), :each, s(:arglist)),
- s(:dasgn_curr, :y),
- s(:dvar, :y)))))
+ s(:lasgn, :y),
+ s(:lvar, :y)))))
# This call causes the replacement of [:lasgn, :x...] above to
# become [:lasgn, :nil]. We then reset the tree to ensure that
@@ -819,8 +723,8 @@ def test_iter
s(:lasgn, :x, s(:array, s(:lit, 1), s(:lit, 2), s(:lit, 3))),
s(:iter,
s(:call, s(:lvar, :x), :each, s(:arglist)),
- s(:dasgn_curr, :y),
- s(:dvar, :y)))))
+ s(:lasgn, :_heckle_dummy),
+ s(:call, nil, :y, s(:arglist))))))
@heckler.process(@heckler.current_tree)
assert_equal(expected, @heckler.current_tree)
Please sign in to comment.
Something went wrong with that request. Please try again.