Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix worked around issue in call where targets don't have the correct …
…parent
- Loading branch information
1 parent
3036f21
commit 5cf516f
Showing
5 changed files
with
44 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'test/unit' | ||
require 'java' | ||
|
||
$CLASSPATH << 'build/mirah-parser.jar' | ||
|
||
class TestAst < Test::Unit::TestCase | ||
java_import 'mirahparser.lang.ast.VCall' | ||
java_import 'mirahparser.lang.ast.FunctionalCall' | ||
java_import 'mirahparser.lang.ast.PositionImpl' | ||
java_import 'mirahparser.lang.ast.StringCodeSource' | ||
java_import 'mirahparser.lang.ast.SimpleString' | ||
|
||
def test_vcall_target_has_parent | ||
call = VCall.new some_position | ||
assert_equal call, call.target.parent | ||
end | ||
|
||
def test_functional_call_target_has_parent | ||
call = FunctionalCall.new some_position | ||
assert_equal call, call.target.parent | ||
end | ||
|
||
def some_position | ||
PositionImpl.new(StringCodeSource.new('blah', 'codegoeshere'), 0, 0, 0, 1, 0, 1) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters