summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-01-22 10:37:45 -0500
committergit <svn-admin@ruby-lang.org>2024-01-22 16:13:36 +0000
commite00f42e5d345ca742dec6f27b851b753ce45ca85 (patch)
tree6ebc56efa0bf35e5da557af8d140ca070e8091c2 /test
parentd68aaa66726b8fe929709521844e46dc20d61d08 (diff)
[ruby/prism] Return 1-indexed line numbers
https://github.com/ruby/prism/commit/ad17f58729
Diffstat (limited to 'test')
-rw-r--r--test/prism/format_errors_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/prism/format_errors_test.rb b/test/prism/format_errors_test.rb
new file mode 100644
index 0000000000..62b24723b8
--- /dev/null
+++ b/test/prism/format_errors_test.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+return if Prism::BACKEND == :FFI
+
+require_relative "test_helper"
+
+module Prism
+ class FormatErrorsTest < TestCase
+ def test_format_errors
+ assert_equal <<~ERROR, Debug.format_errors("<>", false)
+ > 1 | <>
+ | ^ cannot parse the expression
+ | ^ cannot parse the expression
+ ERROR
+ end
+ end
+end