Commit ec5b0556 authored by take_cheeze's avatar take_cheeze

Move direct superclass checking to `test/t/superclass.rb`.

parent 0042e586
......@@ -14,8 +14,3 @@ assert('ArgumentError', '15.2.24') do
assert_equal(Class, ArgumentError.class)
assert_equal(ArgumentError, e2.class)
end
assert('ArgumentError superclass', '15.2.24.2') do
assert_equal(StandardError, ArgumentError.superclass)
end
......@@ -5,10 +5,6 @@ assert('Array', '15.2.12') do
assert_equal(Class, Array.class)
end
assert('Array superclass', '15.2.12.2') do
assert_equal(Object, Array.superclass)
end
assert('Array inclueded modules', '15.2.12.3') do
assert_true(Array.include?(Enumerable))
end
......
......@@ -5,10 +5,6 @@ assert('Class', '15.2.3') do
assert_equal(Class, Class.class)
end
assert('Class superclass', '15.2.3.2') do
assert_equal(Module, Class.superclass)
end
assert('Class#initialize', '15.2.3.3.1') do
c = Class.new do
def test
......
......@@ -5,10 +5,6 @@ assert('Exception', '15.2.22') do
assert_equal Class, Exception.class
end
assert('Exception superclass', '15.2.22.2') do
assert_equal Object, Exception.superclass
end
assert('Exception.exception', '15.2.22.4.1') do
e = Exception.exception('a')
......
......@@ -11,10 +11,6 @@ assert('FalseClass false', '15.2.6.1') do
assert_false FalseClass.method_defined? :new
end
assert('FalseClass superclass', '15.2.6.2') do
assert_equal Object, FalseClass.superclass
end
assert('FalseClass#&', '15.2.6.3.1') do
assert_false false.&(true)
assert_false false.&(false)
......
......@@ -5,10 +5,6 @@ assert('Float', '15.2.9') do
assert_equal Class, Float.class
end
assert('Float superclass', '15.2.9.2') do
assert_equal Numeric, Float.superclass
end
assert('Float#+', '15.2.9.3.1') do
a = 3.123456788 + 0.000000001
b = 3.123456789 + 1
......
......@@ -5,10 +5,6 @@ assert('Hash', '15.2.13') do
assert_equal Class, Hash.class
end
assert('Hash superclass', '15.2.13.2') do
assert_equal Object, Hash.superclass
end
assert('Hash#==', '15.2.13.4.1') do
assert_true({ 'abc' => 'abc' } == { 'abc' => 'abc' })
assert_false({ 'abc' => 'abc' } == { 'cba' => 'cba' })
......
......@@ -4,7 +4,3 @@
assert('IndexError', '15.2.33') do
assert_equal Class, IndexError.class
end
assert('IndexError superclass', '15.2.33.2') do
assert_equal StandardError, IndexError.superclass
end
......@@ -5,10 +5,6 @@ assert('Integer', '15.2.8') do
assert_equal Class, Integer.class
end
assert('Integer superclass', '15.2.8.2') do
assert_equal Numeric, Integer.superclass
end
assert('Integer#+', '15.2.8.3.1') do
a = 1+1
b = 1+1.0
......
......@@ -5,10 +5,6 @@ assert('Module', '15.2.2') do
assert_equal Class, Module.class
end
assert('Module superclass', '15.2.2.2') do
assert_equal Object, Module.superclass
end
# TODO not implemented ATM assert('Module.constants', '15.2.2.3.1') do
# TODO not implemented ATM assert('Module.nesting', '15.2.2.3.2') do
......
......@@ -5,10 +5,6 @@ assert('NameError', '15.2.31') do
assert_equal Class, NameError.class
end
assert('NameError superclass', '15.2.31.2') do
assert_equal StandardError, NameError.superclass
end
assert('NameError#name', '15.2.31.2.1') do
# This check is not duplicate with 15.2.31.2.2 check.
......
......@@ -10,10 +10,6 @@ assert('NilClass', '15.2.4.1') do
assert_false NilClass.method_defined? :new
end
assert('NilClass superclass', '15.2.4.2') do
assert_equal Object, NilClass.superclass
end
assert('NilClass#&', '15.2.4.3.1') do
assert_false nil.&(true)
assert_false nil.&(nil)
......
......@@ -8,10 +8,6 @@ assert('NoMethodError', '15.2.32') do
end
end
assert('NoMethodError superclass', '15.2.32.2') do
assert_equal NameError, NoMethodError.superclass
end
assert('NoMethodError#args', '15.2.32.2.1') do
a = NoMethodError.new 'test', :test, [1, 2]
assert_equal [1, 2], a.args
......
......@@ -5,10 +5,6 @@ assert('Numeric', '15.2.7') do
assert_equal Class, Numeric.class
end
assert('Numeric superclass', '15.2.7.2') do
assert_equal Object, Numeric.superclass
end
assert('Numeric#+@', '15.2.7.4.1') do
assert_equal(+1, +1)
end
......
......@@ -5,10 +5,6 @@ assert('Proc', '15.2.17') do
assert_equal Class, Proc.class
end
assert('Proc superclass', '15.2.17.2') do
assert_equal Object, Proc.superclass
end
assert('Proc.new', '15.2.17.3.1') do
assert_raise ArgumentError do
Proc.new
......
......@@ -5,10 +5,6 @@ assert('Range', '15.2.14') do
assert_equal Class, Range.class
end
assert('Range superclass', '15.2.14.2') do
assert_equal Object, Range.superclass
end
assert('Range#==', '15.2.14.4.1') do
assert_true (1..10) == (1..10)
assert_false (1..10) == (1..100)
......
......@@ -4,7 +4,3 @@
assert('RangeError', '15.2.26') do
assert_equal Class, RangeError.class
end
assert('RangeError superclass', '15.2.26.2') do
assert_equal StandardError, RangeError.superclass
end
......@@ -4,7 +4,3 @@
assert('StandardError', '15.2.23') do
assert_equal Class, StandardError.class
end
assert('StandardError superclass', '15.2.23.2') do
assert_equal Exception, StandardError.superclass
end
......@@ -5,10 +5,6 @@ assert('String', '15.2.10') do
assert_equal Class, String.class
end
assert('String superclass', '15.2.10.2') do
assert_equal Object, String.superclass
end
assert('String#<=>', '15.2.10.5.1') do
a = '' <=> ''
b = '' <=> 'not empty'
......
[
[:Module, :Object, '15.2.2.2'],
[:Class, :Module, '15.2.3.2'],
[:NilClass, :Object, '15.2.4.2'],
[:TrueClass, :Object, '15.2.5.2'],
[:FalseClass, :Object, '15.2.6.2'],
[:Numeric, :Object, '15.2.7.2'],
[:Integer, :Numeric, '15.2.8.2'],
[:Float, :Numeric, '15.2.9.2'],
[:String, :Object, '15.2.10.2'],
[:Symbol, :Object, '15.2.11.2'],
[:Array, :Object, '15.2.12.2'],
[:Hash, :Object, '15.2.13.2'],
[:Range, :Object, '15.2.14.2'],
[:Proc, :Object, '15.2.17.2'],
[:Exception, :Object, '15.2.22.2'],
[:StandardError, :Exception, '15.2.23.2'],
[:ArgumentError, :StandardError, '15.2.24.2'],
[:RangeError, :StandardError, '12.2.26.2'],
[:TypeError, :StandardError, '12.2.29.2'],
[:NameError, :StandardError, '15.2.31.2'],
[:NoMethodError, :NameError, '15.2.32.2'],
[:IndexError, :StandardError, '15.2.33.2'],
].each do |cls, super_cls, iso|
assert "Direct superclass of #{cls}", iso do
assert_true Object.const_defined? cls
assert_true Object.const_defined? super_cls
assert_equal Object.const_get(super_cls), Object.const_get(cls).superclass
end
end
......@@ -5,10 +5,6 @@ assert('Symbol', '15.2.11') do
assert_equal Class, Symbol.class
end
assert('Symbol superclass', '15.2.11.2') do
assert_equal Object, Symbol.superclass
end
assert('Symbol#===', '15.2.11.3.1') do
assert_true :abc == :abc
assert_false :abc == :cba
......
......@@ -11,10 +11,6 @@ assert('TrueClass true', '15.2.5.1') do
assert_false TrueClass.method_defined? :new
end
assert('TrueClass superclass', '15.2.5.2') do
assert_equal Object, TrueClass.superclass
end
assert('TrueClass#&', '15.2.5.3.1') do
assert_true true.&(true)
assert_false true.&(false)
......
......@@ -4,8 +4,3 @@
assert('TypeError', '15.2.29') do
assert_equal Class, TypeError.class
end
assert('TypeError superclass', '15.2.29.2') do
assert_equal StandardError, TypeError.superclass
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment