mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
701217572f
``` /home/chkbuild/chkbuild/tmp/build/20200818T033004Z/ruby/test/fiber/test_backtrace.rb:9: warning: ambiguous first argument; put parentheses or a space even after `/' operator /home/chkbuild/chkbuild/tmp/build/20200818T033004Z/ruby/test/fiber/test_backtrace.rb:15: warning: ambiguous first argument; put parentheses or a space even after `/' operator ```
22 lines
572 B
Ruby
22 lines
572 B
Ruby
# frozen_string_literal: true
|
|
require 'test/unit'
|
|
require 'fiber'
|
|
|
|
class TestFiberBacktrace < Test::Unit::TestCase
|
|
def test_backtrace
|
|
backtrace = Fiber.current.backtrace
|
|
assert_kind_of Array, backtrace
|
|
assert_match(/test_backtrace/, backtrace[0])
|
|
end
|
|
|
|
def test_backtrace_locations
|
|
backtrace = Fiber.current.backtrace_locations
|
|
assert_kind_of Array, backtrace
|
|
assert_match(/test_backtrace_locations/, backtrace[1].label)
|
|
end
|
|
|
|
def test_local_backtrace
|
|
backtrace = Fiber.current.backtrace(2)
|
|
assert_equal backtrace, caller
|
|
end
|
|
end
|