From 03090e2e72f3308571db9c9b76b4126fc271d6ec Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sun, 1 Feb 2026 20:36:13 +0100 Subject: [ruby/prism] Change `bin/prism errors` to take source and print errors This is more akin to how all the other ones work. Instead I added most of this to the errors test like focusing a few specifically and creating new expectations. https://github.com/ruby/prism/commit/b21922b0a1 --- test/prism/errors_test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index cbe8b06ad6..b30a0f304d 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -7,7 +7,7 @@ require_relative "test_helper" module Prism class ErrorsTest < TestCase base = File.expand_path("errors", __dir__) - filepaths = Dir["**/*.txt", base: base] + filepaths = Dir[ENV.fetch("FOCUS", "**/*.txt"), base: base] filepaths.each do |filepath| ruby_versions_for(filepath).each do |version| @@ -100,6 +100,10 @@ module Prism refute_empty errors, "Expected errors in #{filepath}" actual = result.errors_format + if expected != actual && ENV["UPDATE_SNAPSHOTS"] + File.write(filepath, actual) + end + assert_equal expected, actual, "Expected errors to match for #{filepath}" end end -- cgit v1.2.3