summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/mrbconf.h6
-rw-r--r--include/mruby.h8
-rw-r--r--mrbgems/mruby-string-ext/mrblib/string.rb70
-rw-r--r--mrbgems/mruby-string-ext/test/string.rb58
-rw-r--r--mrbgems/mruby-struct/test/struct.rb4
-rw-r--r--mrbgems/mruby-time/test/time.rb4
-rw-r--r--src/state.c8
-rw-r--r--src/variable.c12
-rw-r--r--test/t/argumenterror.rb5
-rw-r--r--test/t/array.rb4
-rw-r--r--test/t/class.rb4
-rw-r--r--test/t/exception.rb4
-rw-r--r--test/t/false.rb4
-rw-r--r--test/t/float.rb4
-rw-r--r--test/t/hash.rb4
-rw-r--r--test/t/indexerror.rb4
-rw-r--r--test/t/integer.rb4
-rw-r--r--test/t/module.rb4
-rw-r--r--test/t/nameerror.rb4
-rw-r--r--test/t/nil.rb4
-rw-r--r--test/t/nomethoderror.rb4
-rw-r--r--test/t/numeric.rb4
-rw-r--r--test/t/proc.rb4
-rw-r--r--test/t/range.rb4
-rw-r--r--test/t/rangeerror.rb4
-rw-r--r--test/t/standarderror.rb4
-rw-r--r--test/t/string.rb4
-rw-r--r--test/t/superclass.rb46
-rw-r--r--test/t/symbol.rb4
-rw-r--r--test/t/true.rb4
-rw-r--r--test/t/typeerror.rb5
31 files changed, 202 insertions, 104 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index c84b32cd8..ac33ff0bf 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -59,6 +59,12 @@
/* fixed size GC arena */
//#define MRB_GC_FIXED_ARENA
+/* state atexit stack size */
+//#define MRB_FIXED_STATE_ATEXIT_STACK_SIZE 5
+
+/* fixed size state atexit stack */
+//#define MRB_FIXED_STATE_ATEXIT_STACK
+
/* -DDISABLE_XXXX to drop following features */
//#define DISABLE_STDIO /* use of stdio */
diff --git a/include/mruby.h b/include/mruby.h
index dcc01b2dd..7b9f1b428 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -52,6 +52,10 @@ typedef void* (*mrb_allocf) (struct mrb_state *mrb, void*, size_t, void *ud);
#define MRB_GC_ARENA_SIZE 100
#endif
+#ifndef MRB_FIXED_STATE_ATEXIT_STACK_SIZE
+#define MRB_FIXED_STATE_ATEXIT_STACK_SIZE 5
+#endif
+
typedef struct {
mrb_sym mid;
struct RProc *proc;
@@ -173,7 +177,11 @@ typedef struct mrb_state {
void *ud; /* auxiliary data */
+#ifdef MRB_FIXED_STATE_ATEXIT_STACK
+ mrb_atexit_func atexit_stack[MRB_FIXED_STATE_ATEXIT_STACK_SIZE];
+#else
mrb_atexit_func *atexit_stack;
+#endif
mrb_int atexit_stack_len;
} mrb_state;
diff --git a/mrbgems/mruby-string-ext/mrblib/string.rb b/mrbgems/mruby-string-ext/mrblib/string.rb
index 1cfb7e2f5..1acdf150f 100644
--- a/mrbgems/mruby-string-ext/mrblib/string.rb
+++ b/mrbgems/mruby-string-ext/mrblib/string.rb
@@ -146,4 +146,74 @@ class String
[ "", "", self ]
end
end
+
+ ##
+ # call-seq:
+ # str.slice!(fixnum) -> new_str or nil
+ # str.slice!(fixnum, fixnum) -> new_str or nil
+ # str.slice!(range) -> new_str or nil
+ # str.slice!(other_str) -> new_str or nil
+ #
+ # Deletes the specified portion from <i>str</i>, and returns the portion
+ # deleted.
+ #
+ # string = "this is a string"
+ # string.slice!(2) #=> "i"
+ # string.slice!(3..6) #=> " is "
+ # string.slice!("r") #=> "r"
+ # string #=> "thsa sting"
+ #
+ def slice!(arg1, arg2=nil)
+ raise "wrong number of arguments (for 1..2)" if arg1 == nil && arg2 == nil
+
+ if arg1 != nil && arg2 != nil
+ idx = arg1
+ idx += self.size if arg1 < 0
+ if idx >= 0 && idx < self.size && arg2 > 0
+ str = self[idx, arg2]
+ else
+ return nil
+ end
+ else
+ validated = false
+ if arg1.kind_of?(Range)
+ beg = arg1.begin
+ ed = arg1.end
+ beg += self.size if beg < 0
+ ed += self.size if ed < 0
+ validated = true
+ elsif arg1.kind_of?(String)
+ validated = true
+ else
+ idx = arg1
+ idx += self.size if arg1 < 0
+ validated = true if idx >=0 && arg1 < self.size
+ end
+ if validated
+ str = self[arg1]
+ else
+ return nil
+ end
+ end
+ unless str == nil || str == ""
+ if arg1 != nil && arg2 !=nil
+ idx = arg1 >= 0 ? arg1 : self.size+arg1
+ str2 = self[0...idx] + self[idx+arg2..-1]
+ else
+ if arg1.kind_of?(Range)
+ idx = beg >= 0 ? beg : self.size+beg
+ idx2 = ed>= 0 ? ed : self.size+ed
+ str2 = self[0...idx] + self[idx2+1..-1]
+ elsif arg1.kind_of?(String)
+ idx = self.index(arg1)
+ str2 = self[0...idx] + self[idx+arg1.size..-1] unless idx == nil
+ else
+ idx = arg1 >= 0 ? arg1 : self.size+arg1
+ str2 = self[0...idx] + self[idx+1..-1]
+ end
+ end
+ self.replace(str2) unless str2 == nil
+ end
+ str
+ end
end
diff --git a/mrbgems/mruby-string-ext/test/string.rb b/mrbgems/mruby-string-ext/test/string.rb
index 72c919b35..01c0be9d2 100644
--- a/mrbgems/mruby-string-ext/test/string.rb
+++ b/mrbgems/mruby-string-ext/test/string.rb
@@ -193,3 +193,61 @@ assert('String#clear') do
assert_equal("", s) # s is cleared
assert_not_equal("", a) # a should not be affected
end
+
+assert('String#slice!') do
+ a = "AooBar"
+ b = a.dup
+ assert_equal "A", a.slice!(0)
+ assert_equal "AooBar", b
+
+ a = "FooBar"
+ assert_equal "r", a.slice!(-1)
+ assert_equal "FooBa", a
+
+ a = "FooBar"
+ assert_nil a.slice!(6)
+ assert_nil a.slice!(-7)
+ assert_equal "FooBar", a
+
+ a = "FooBar"
+ assert_equal "Foo", a.slice!(0, 3)
+ assert_equal "Bar", a
+
+ a = "FooBar"
+ assert_equal "Bar", a.slice!(-3, 3)
+ assert_equal "Foo", a
+
+ a = "FooBar"
+ assert_nil a.slice!(6, 2)
+ assert_equal "FooBar", a
+
+ a = "FooBar"
+ assert_nil a.slice!(-7,10)
+ assert_equal "FooBar", a
+
+ a = "FooBar"
+ assert_equal "Foo", a.slice!(0..2)
+ assert_equal "Bar", a
+
+ a = "FooBar"
+ assert_equal "Bar", a.slice!(-3..-1)
+ assert_equal "Foo", a
+
+ a = "FooBar"
+ assert_equal "", a.slice!(6..2)
+ assert_equal "FooBar", a
+
+ a = "FooBar"
+ assert_nil a.slice!(-10..-7)
+ assert_equal "FooBar", a
+
+ a = "FooBar"
+ assert_equal "Foo", a.slice!("Foo")
+ assert_equal "Bar", a
+
+ a = "FooBar"
+ assert_nil a.slice!("xyzzy")
+ assert_equal "FooBar", a
+
+ assert_raise(ArgumentError) { "foo".slice! }
+end
diff --git a/mrbgems/mruby-struct/test/struct.rb b/mrbgems/mruby-struct/test/struct.rb
index f4151c493..911e657bd 100644
--- a/mrbgems/mruby-struct/test/struct.rb
+++ b/mrbgems/mruby-struct/test/struct.rb
@@ -5,10 +5,6 @@ assert('Struct', '15.2.18') do
Struct.class == Class
end
-assert('Struct superclass', '15.2.18.2') do
- Struct.superclass == Object
-end
-
assert('Struct.new', '15.2.18.3.1') do
c = Struct.new(:m1, :m2)
c.superclass == Struct and
diff --git a/mrbgems/mruby-time/test/time.rb b/mrbgems/mruby-time/test/time.rb
index 450d87b43..ba9b48fab 100644
--- a/mrbgems/mruby-time/test/time.rb
+++ b/mrbgems/mruby-time/test/time.rb
@@ -9,10 +9,6 @@ assert('Time', '15.2.19') do
Time.class == Class
end
-assert('Time superclass', '15.2.19.2') do
- Time.superclass == Object
-end
-
assert('Time.at', '15.2.19.6.1') do
Time.at(1300000000.0)
end
diff --git a/src/state.c b/src/state.c
index c0a9c14c2..3e82a159d 100644
--- a/src/state.c
+++ b/src/state.c
@@ -226,7 +226,9 @@ mrb_close(mrb_state *mrb)
for (i = mrb->atexit_stack_len; i > 0; --i) {
mrb->atexit_stack[i - 1](mrb);
}
+#ifndef MRB_FIXED_STATE_ATEXIT_STACK
mrb_free(mrb, mrb->atexit_stack);
+#endif
}
/* free */
@@ -268,6 +270,11 @@ mrb_top_self(mrb_state *mrb)
void
mrb_state_atexit(mrb_state *mrb, mrb_atexit_func f)
{
+#ifdef MRB_FIXED_STATE_ATEXIT_STACK
+ if (mrb->atexit_stack_len + 1 > MRB_FIXED_STATE_ATEXIT_STACK_SIZE) {
+ mrb_raise(mrb, E_RUNTIME_ERROR, "exceeded fixed state atexit stack limit");
+ }
+#else
size_t stack_size;
stack_size = sizeof(mrb_atexit_func) * (mrb->atexit_stack_len + 1);
@@ -276,6 +283,7 @@ mrb_state_atexit(mrb_state *mrb, mrb_atexit_func f)
} else {
mrb->atexit_stack = (mrb_atexit_func*)mrb_realloc(mrb, mrb->atexit_stack, stack_size);
}
+#endif
mrb->atexit_stack[mrb->atexit_stack_len++] = f;
}
diff --git a/src/variable.c b/src/variable.c
index 5f762dd0b..74bb591cf 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -124,10 +124,10 @@ iv_put(mrb_state *mrb, iv_tbl *t, mrb_sym sym, mrb_value val)
* mrb
* t the variable table to be searched.
* sym the symbol to be used as the key.
- * vp the value pointer. Recieves the value if the specified symbol contains
- * in the instance variable table.
+ * vp the value pointer. Receives the value if the specified symbol is
+ * contained in the instance variable table.
* Returns
- * true if the specfiyed symbol contains in the instance variable table.
+ * true if the specified symbol is contained in the instance variable table.
*/
static mrb_bool
iv_get(mrb_state *mrb, iv_tbl *t, mrb_sym sym, mrb_value *vp)
@@ -159,10 +159,10 @@ iv_get(mrb_state *mrb, iv_tbl *t, mrb_sym sym, mrb_value *vp)
* Parameters
* t the variable table to be searched.
* sym the symbol to be used as the key.
- * vp the value pointer. Recieve the deleted value if the symbol contans
- * in the instance varible table.
+ * vp the value pointer. Receive the deleted value if the symbol is
+ * contained in the instance variable table.
* Returns
- * true if the specfied symbol contains in the instance variable table.
+ * true if the specified symbol is contained in the instance variable table.
*/
static mrb_bool
iv_del(mrb_state *mrb, iv_tbl *t, mrb_sym sym, mrb_value *vp)
diff --git a/test/t/argumenterror.rb b/test/t/argumenterror.rb
index c8d277cc5..abb53429b 100644
--- a/test/t/argumenterror.rb
+++ b/test/t/argumenterror.rb
@@ -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
-
diff --git a/test/t/array.rb b/test/t/array.rb
index 56daf0b01..538ea0c3f 100644
--- a/test/t/array.rb
+++ b/test/t/array.rb
@@ -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
diff --git a/test/t/class.rb b/test/t/class.rb
index 821259c5e..f49ccf494 100644
--- a/test/t/class.rb
+++ b/test/t/class.rb
@@ -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
diff --git a/test/t/exception.rb b/test/t/exception.rb
index be487162f..d27813028 100644
--- a/test/t/exception.rb
+++ b/test/t/exception.rb
@@ -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')
diff --git a/test/t/false.rb b/test/t/false.rb
index bc684f2e6..3582f697a 100644
--- a/test/t/false.rb
+++ b/test/t/false.rb
@@ -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)
diff --git a/test/t/float.rb b/test/t/float.rb
index ded434320..d45709173 100644
--- a/test/t/float.rb
+++ b/test/t/float.rb
@@ -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
diff --git a/test/t/hash.rb b/test/t/hash.rb
index 0d8d137c4..eee7c7b6a 100644
--- a/test/t/hash.rb
+++ b/test/t/hash.rb
@@ -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' })
diff --git a/test/t/indexerror.rb b/test/t/indexerror.rb
index ea008a227..a8dce23a0 100644
--- a/test/t/indexerror.rb
+++ b/test/t/indexerror.rb
@@ -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
diff --git a/test/t/integer.rb b/test/t/integer.rb
index 6560dddfe..c50ef112c 100644
--- a/test/t/integer.rb
+++ b/test/t/integer.rb
@@ -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
diff --git a/test/t/module.rb b/test/t/module.rb
index fcf46fe3a..5ac794330 100644
--- a/test/t/module.rb
+++ b/test/t/module.rb
@@ -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
diff --git a/test/t/nameerror.rb b/test/t/nameerror.rb
index 3e3c59264..28682bedc 100644
--- a/test/t/nameerror.rb
+++ b/test/t/nameerror.rb
@@ -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.
diff --git a/test/t/nil.rb b/test/t/nil.rb
index 971ce2e8e..53b922f9a 100644
--- a/test/t/nil.rb
+++ b/test/t/nil.rb
@@ -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)
diff --git a/test/t/nomethoderror.rb b/test/t/nomethoderror.rb
index 709d31165..5fed79689 100644
--- a/test/t/nomethoderror.rb
+++ b/test/t/nomethoderror.rb
@@ -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
diff --git a/test/t/numeric.rb b/test/t/numeric.rb
index ef977da29..2b01611a7 100644
--- a/test/t/numeric.rb
+++ b/test/t/numeric.rb
@@ -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
diff --git a/test/t/proc.rb b/test/t/proc.rb
index 9c1b7d4c7..22ccceb68 100644
--- a/test/t/proc.rb
+++ b/test/t/proc.rb
@@ -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
diff --git a/test/t/range.rb b/test/t/range.rb
index b35da40ab..278b26902 100644
--- a/test/t/range.rb
+++ b/test/t/range.rb
@@ -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)
diff --git a/test/t/rangeerror.rb b/test/t/rangeerror.rb
index 8dc683745..97878096e 100644
--- a/test/t/rangeerror.rb
+++ b/test/t/rangeerror.rb
@@ -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
diff --git a/test/t/standarderror.rb b/test/t/standarderror.rb
index cab99834e..c349b08cf 100644
--- a/test/t/standarderror.rb
+++ b/test/t/standarderror.rb
@@ -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
diff --git a/test/t/string.rb b/test/t/string.rb
index 00e98f671..c0e545e87 100644
--- a/test/t/string.rb
+++ b/test/t/string.rb
@@ -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'
diff --git a/test/t/superclass.rb b/test/t/superclass.rb
new file mode 100644
index 000000000..9fd8830b3
--- /dev/null
+++ b/test/t/superclass.rb
@@ -0,0 +1,46 @@
+[
+ # [:Object, :implementation_defined_value, '15.2.2.1'],
+ [: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'],
+# [:Regexp, :Object, '15.2.15.2'], #No Regexp in mruby core
+# [:MatchData, :Object, '15.2.16.2'],
+ [:Proc, :Object, '15.2.17.2'],
+# [:Struct, :Object, '15.2.18.2'],
+# [:Time, :Object, '15.2.19.2'],
+# [:IO, :Object, '15.2.20.2'],
+# [:File, :IO, '15.2.21.2'],
+ [:Exception, :Object, '15.2.22.2'],
+ [:StandardError, :Exception, '15.2.23.2'],
+ [:ArgumentError, :StandardError, '15.2.24.2'],
+ [:LocalJumpError, :StandardError, '15.2.25.2'],
+ [:RangeError, :StandardError, '12.2.26.2'],
+ [:RegexpError, :StandardError, '12.2.27.2'],
+ [:RuntimeError, :StandardError, '12.2.28.2'],
+ [:TypeError, :StandardError, '12.2.29.2'],
+# [:ZeroDivisionError, :StandardError, '12.2.30.2'], # No ZeroDivisionError in mruby
+ [:NameError, :StandardError, '15.2.31.2'],
+ [:NoMethodError, :NameError, '15.2.32.2'],
+ [:IndexError, :StandardError, '15.2.33.2'],
+# [:IOError, :StandardError, '12.2.34.2'],
+# [:EOFError, :IOError, '12.2.35.2'],
+# [:SystemCallError, :StandardError, '15.2.36.2'],
+ [:ScriptError, :Exception, '12.2.37.2'],
+ [:SyntaxError, :ScriptError, '12.2.38.2'],
+# [:LoadError, :ScriptError, '12.2.39,2'],
+].each do |cls, super_cls, iso|
+ assert "Direct superclass of #{cls}", iso do
+ skip "#{cls} isn't defined" unless Object.const_defined? cls
+ assert_equal Object.const_get(super_cls), Object.const_get(cls).superclass
+ end
+end
diff --git a/test/t/symbol.rb b/test/t/symbol.rb
index f852dcd00..b0252849d 100644
--- a/test/t/symbol.rb
+++ b/test/t/symbol.rb
@@ -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
diff --git a/test/t/true.rb b/test/t/true.rb
index e5da2112c..74f605ef0 100644
--- a/test/t/true.rb
+++ b/test/t/true.rb
@@ -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)
diff --git a/test/t/typeerror.rb b/test/t/typeerror.rb
index a91fb1be2..32536a74f 100644
--- a/test/t/typeerror.rb
+++ b/test/t/typeerror.rb
@@ -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
-