Skip to content

Commit

Permalink
Testcase for bug mirah#25.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixvf committed Jul 21, 2015
1 parent a479d27 commit 7eede3e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test_mirah.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,26 @@ def test_position
assert_equal("TestParsing-1", ast.position.source.name)
end

def test_position_after_multiline_sstring_literal
ast = parse("SOMECONST = \'\n\n\n\'\n foo ").body.get(1)
assert_equal("foo", ast.name.identifier)
assert_equal(5, ast.position.start_line)
assert_equal(3, ast.position.start_column)
assert_equal(5, ast.position.end_line)
assert_equal(6, ast.position.end_column)
assert_equal("TestParsing-1", ast.position.source.name)
end

def test_position_after_multiline_dstring_literal
ast = parse("SOMECONST = \"\n\n\n\"\n foo ").body.get(1)
assert_equal("foo", ast.name.identifier)
assert_equal(5, ast.position.start_line)
assert_equal(3, ast.position.start_column)
assert_equal(5, ast.position.end_line)
assert_equal(6, ast.position.end_column)
assert_equal("TestParsing-1", ast.position.source.name)
end

def test_modified_position
ast = MirahParser.new.parse(
StringCodeSource.new("test_modified_position", "foo", 3, 5)).body.get(0)
Expand Down

0 comments on commit 7eede3e

Please sign in to comment.