File: nameerror.rb

package info (click to toggle)
groonga 9.0.0-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 101,496 kB
  • sloc: ansic: 608,707; ruby: 35,042; xml: 23,643; cpp: 10,319; sh: 7,453; yacc: 5,968; python: 3,033; makefile: 2,609; perl: 133
file content (28 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
##
# NameError ISO Test

assert('NameError', '15.2.31') do
  assert_equal Class, NameError.class
end

assert('NameError#name', '15.2.31.2.1') do

  # This check is not duplicate with 15.2.31.2.2 check.
  # Because the NameError in this test is generated in
  # C API.
  class TestDummy
    alias foo bar
  rescue NameError => e
    $test_dummy_result = e.name
  end

  assert_equal :bar, $test_dummy_result
end

assert('NameError#initialize', '15.2.31.2.2') do
   e = NameError.new('a', :foo)

   assert_equal NameError, e.class
   assert_equal 'a', e.message
   assert_equal :foo, e.name
end