mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
resolve conflict in test/t/class.rb
This commit is contained in:
@@ -10,6 +10,36 @@ assert('Class#superclass', '15.2.3.3.4') do
|
||||
SubClass.superclass == String
|
||||
end
|
||||
|
||||
assert('Class#new', '15.2.3.3.3') do
|
||||
# at the moment no exception on singleton class
|
||||
#e1 = nil
|
||||
#begin
|
||||
# class1 = e1.singleton_class.new
|
||||
#rescue => e1
|
||||
# e2 = e1
|
||||
#end
|
||||
|
||||
class TestClass
|
||||
def initialize args, &block
|
||||
@result = if not args.nil? and block.nil?
|
||||
# only arguments
|
||||
:only_args
|
||||
elsif not args.nil? and not block.nil?
|
||||
# args and block is given
|
||||
:args_and_block
|
||||
else
|
||||
# this should never happen
|
||||
:broken
|
||||
end
|
||||
end
|
||||
|
||||
def result; @result; end
|
||||
end
|
||||
|
||||
TestClass.new(:arg).result == :only_args
|
||||
# with block doesn't work yet
|
||||
end
|
||||
|
||||
# Not ISO specified
|
||||
|
||||
assert('Class 1') do
|
||||
|
||||
Reference in New Issue
Block a user