diff options
author | Jean Boussier <[email protected]> | 2023-07-13 11:49:28 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2023-07-24 14:51:20 +0200 |
commit | 43a5c191358699fe8b19314763998cb8ca77ed90 (patch) | |
tree | efebe1570ca2c77a66bfb81edeb3f86044e63174 /test/ruby/test_exception.rb | |
parent | 14d16bdb1ad8e98d76ec2c43b2c1c412ff707d0b (diff) |
Use the caller location as default filename for eval family of methods
[Feature #19755]
Before (in /tmp/test.rb):
```ruby
Object.class_eval("p __FILE__") # => "(eval)"
```
After:
```ruby
Object.class_eval("p __FILE__") # => "(eval at /tmp/test.rb:1)"
```
This makes it much easier to track down generated code in case
the author forgot to provide a filename argument.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8070
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r-- | test/ruby/test_exception.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 0f39a15b2d..03f0d58581 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1310,7 +1310,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| def test_backtrace_in_eval bug = '[ruby-core:84434] [Bug #14229]' - assert_in_out_err(['-e', 'eval("raise")'], "", [], /^\(eval\):1:/, bug) + assert_in_out_err(['-e', 'eval("raise")'], "", [], /^\(eval at .*\):1:/, bug) end def test_full_message |