summaryrefslogtreecommitdiffhomepage
path: root/test/t/kernel.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-04-08 12:11:18 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2013-04-08 12:11:18 -0700
commit87cd4c5ecc69208018c4d9deea63d566974561dd (patch)
tree91e914936c38b23d35f4f7bc4694c78036a54363 /test/t/kernel.rb
parent1b40c057f56ffa87abc7c5db467c91981db610f8 (diff)
parent91db2904124c66ee44499a6f93ceb2e56a99642c (diff)
downloadmruby-87cd4c5ecc69208018c4d9deea63d566974561dd.tar.gz
mruby-87cd4c5ecc69208018c4d9deea63d566974561dd.zip
Merge pull request #1144 from monaka/pr-add-iso-conformance-tests-20130406
Add more ISO conformance tests.
Diffstat (limited to 'test/t/kernel.rb')
-rw-r--r--test/t/kernel.rb25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/t/kernel.rb b/test/t/kernel.rb
index 835834359..abc8f260b 100644
--- a/test/t/kernel.rb
+++ b/test/t/kernel.rb
@@ -155,6 +155,16 @@ assert('Kernel#clone', '15.3.1.3.8') do
a.set(2)
c = a.clone
+ immutables = [ 1, :foo, true, false, nil ]
+ error_count = 0
+ immutables.each do |i|
+ begin
+ i.clone
+ rescue TypeError
+ error_count += 1
+ end
+ end
+
a.get == 2 and b.get == 1 and c.get == 2 &&
a.respond_to?(:test) == true and
b.respond_to?(:test) == false and
@@ -185,7 +195,18 @@ assert('Kernel#dup', '15.3.1.3.9') do
a.set(2)
c = a.dup
- a.get == 2 and b.get == 1 and c.get == 2 and
+ immutables = [ 1, :foo, true, false, nil ]
+ error_count = 0
+ immutables.each do |i|
+ begin
+ i.dup
+ rescue TypeError
+ error_count += 1
+ end
+ end
+
+ error_count == immutables.size and
+ a.get == 2 and b.get == 1 and c.get == 2 and
a.respond_to?(:test) == true and
b.respond_to?(:test) == false and
c.respond_to?(:test) == false
@@ -330,6 +351,8 @@ assert('Kernel#raise', '15.3.1.3.40') do
e_list[1].class == RuntimeError
end
+# Kernel#require is defined in mruby-require. '15.3.1.3.42'
+
assert('Kernel#respond_to?', '15.3.1.3.43') do
class Test4RespondTo
def test_method; end