diff options
| author | Earlopain <14981592+Earlopain@users.noreply.github.com> | 2026-02-01 20:36:13 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-02-02 18:26:54 +0000 |
| commit | 03090e2e72f3308571db9c9b76b4126fc271d6ec (patch) | |
| tree | 9ffd761b97519c884d844405b0c37ff36c6e1289 /test | |
| parent | 30d2e0cd6b94752e939025e2d5751f4b24e601ff (diff) | |
[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
Diffstat (limited to 'test')
| -rw-r--r-- | test/prism/errors_test.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 |
