From 957cd369fa38915241e0b66e852f66ac516de664 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 14 Aug 2023 13:58:24 -0400 Subject: [PATCH] [ruby/yarp] Add test for empty heredoc https://github.com/ruby/yarp/commit/e49b63a79e --- test/yarp/fixtures/dash_heredocs.txt | 3 +++ test/yarp/snapshots/dash_heredocs.txt | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/yarp/fixtures/dash_heredocs.txt b/test/yarp/fixtures/dash_heredocs.txt index a05df93023..aba782c99a 100644 --- a/test/yarp/fixtures/dash_heredocs.txt +++ b/test/yarp/fixtures/dash_heredocs.txt @@ -39,6 +39,9 @@ EOF b EOF +<<-'' + + <<-'EOF' a #{1} EOF diff --git a/test/yarp/snapshots/dash_heredocs.txt b/test/yarp/snapshots/dash_heredocs.txt index bc4c90a76f..ad79c46251 100644 --- a/test/yarp/snapshots/dash_heredocs.txt +++ b/test/yarp/snapshots/dash_heredocs.txt @@ -1,6 +1,6 @@ -ProgramNode(0...223)( +ProgramNode(0...231)( [], - StatementsNode(0...223)( + StatementsNode(0...231)( [InterpolatedStringNode(0...15)( (0...6), [StringNode(7...11)(nil, (7...11), nil, " a\n")], @@ -112,10 +112,11 @@ ProgramNode(0...223)( [StringNode(188...196)(nil, (188...196), nil, " a\n" + " b\n")], (196...200) ), - InterpolatedStringNode(201...223)( - (201...209), - [StringNode(210...219)(nil, (210...219), nil, " a \#{1}\n")], - (219...223) + InterpolatedStringNode(201...208)((201...206), [], (207...208)), + InterpolatedStringNode(209...231)( + (209...217), + [StringNode(218...227)(nil, (218...227), nil, " a \#{1}\n")], + (227...231) )] ) )