Skip to content

Commit

Permalink
Merge pull request #3141 from masukomi/heredoc_mixed_tabs_and_spaces
Browse files Browse the repository at this point in the history
added spec tests to confirm heredocs work tabs + spaces
  • Loading branch information
asterite committed Aug 12, 2016
2 parents 0c5bb33 + 9ba646f commit 7124a30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/compiler/parser/parser_spec.cr
Expand Up @@ -1152,6 +1152,9 @@ describe "Parser" do
it_parses "<<-FOO\n1\nFOO + 2", Call.new("1".string, "+", 2.int32)

it_parses "<<-FOO\n\t1\n\tFOO", StringLiteral.new("1")
it_parses "<<-FOO\n \t1\n \tFOO", StringLiteral.new("1")
it_parses "<<-FOO\n \t 1\n \t FOO", StringLiteral.new("1")
it_parses "<<-FOO\n\t 1\n\t FOO", StringLiteral.new("1")

it_parses "enum Foo; A\nB, C\nD = 1; end", EnumDef.new("Foo".path, [Arg.new("A"), Arg.new("B"), Arg.new("C"), Arg.new("D", 1.int32)] of ASTNode)
it_parses "enum Foo; A = 1, B; end", EnumDef.new("Foo".path, [Arg.new("A", 1.int32), Arg.new("B")] of ASTNode)
Expand Down

0 comments on commit 7124a30

Please sign in to comment.