summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_backtrace.rb6
-rw-r--r--test/ruby/test_zjit.rb15
2 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_backtrace.rb b/test/ruby/test_backtrace.rb
index fca7b62030..01a757f827 100644
--- a/test/ruby/test_backtrace.rb
+++ b/test/ruby/test_backtrace.rb
@@ -454,4 +454,10 @@ class TestBacktrace < Test::Unit::TestCase
foo::Bar.baz
end;
end
+
+ def test_backtrace_internal_frame
+ backtrace = tap { break caller_locations(0) }
+ assert_equal(__FILE__, backtrace[1].path) # not "<internal:kernel>"
+ assert_equal("Kernel#tap", backtrace[1].label)
+ end
end
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 2b171b02b1..e10e9a8742 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -76,6 +76,21 @@ class TestZJIT < Test::Unit::TestCase
}
end
+ def test_invokebuiltin
+ assert_compiles '["."]', %q{
+ def test = Dir.glob(".")
+ test
+ }
+ end
+
+ def test_invokebuiltin_delegate
+ assert_compiles '[[], true]', %q{
+ def test = [].clone(freeze: true)
+ r = test
+ [r, r.frozen?]
+ }
+ end
+
def test_opt_plus_const
assert_compiles '3', %q{
def test = 1 + 2