summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/snapshots/newline-terminated-things.txt6
-rw-r--r--test/yarp/fixtures/newline-terminated-things.txt2
-rw-r--r--test/yarp/parse_test.rb2
3 files changed, 10 insertions, 0 deletions
diff --git a/test/snapshots/newline-terminated-things.txt b/test/snapshots/newline-terminated-things.txt
new file mode 100644
index 0000000000..e68ea1658e
--- /dev/null
+++ b/test/snapshots/newline-terminated-things.txt
@@ -0,0 +1,6 @@
+ProgramNode(0...7)(
+ [],
+ StatementsNode(0...7)(
+ [RegularExpressionNode(0...7)((0...3), (3...6), (6...7), "foo", 0)]
+ )
+)
diff --git a/test/yarp/fixtures/newline-terminated-things.txt b/test/yarp/fixtures/newline-terminated-things.txt
new file mode 100644
index 0000000000..27e7c62e8e
--- /dev/null
+++ b/test/yarp/fixtures/newline-terminated-things.txt
@@ -0,0 +1,2 @@
+%r
+foo
diff --git a/test/yarp/parse_test.rb b/test/yarp/parse_test.rb
index 7a910f7db2..33eb1475f5 100644
--- a/test/yarp/parse_test.rb
+++ b/test/yarp/parse_test.rb
@@ -120,6 +120,8 @@ class ParseTest < Test::Unit::TestCase
end
Dir["*.txt", base: base].each do |relative|
+ next if relative == "newline_terminated.txt"
+
# We test every snippet (separated by \n\n) in isolation
# to ensure the parser does not try to read bytes further than the end of each snippet
define_method "test_individual_snippets_#{relative}" do