From e00f42e5d345ca742dec6f27b851b753ce45ca85 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 22 Jan 2024 10:37:45 -0500 Subject: [ruby/prism] Return 1-indexed line numbers https://github.com/ruby/prism/commit/ad17f58729 --- test/prism/format_errors_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/prism/format_errors_test.rb (limited to 'test') 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 -- cgit v1.2.3