summaryrefslogtreecommitdiffhomepage
path: root/test/t/array.rb
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-05-14 23:04:13 +0900
committerYukihiro Matsumoto <[email protected]>2012-05-14 23:04:13 +0900
commit8085817cb5737ca0c2a4afb5e3d013a395e12eb4 (patch)
tree633371b8956a39b5c570d745bdfa963e42111158 /test/t/array.rb
parent0c6ff97b8e88e6f848ba73a2bf799de98d27a526 (diff)
downloadmruby-8085817cb5737ca0c2a4afb5e3d013a395e12eb4.tar.gz
mruby-8085817cb5737ca0c2a4afb5e3d013a395e12eb4.zip
make test restructuring
Diffstat (limited to 'test/t/array.rb')
-rw-r--r--test/t/array.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/t/array.rb b/test/t/array.rb
new file mode 100644
index 000000000..3b65a80dd
--- /dev/null
+++ b/test/t/array.rb
@@ -0,0 +1,40 @@
+##
+# Array ISO Test
+
+assert('Array', '15.2.12') do
+ Array.class == Class
+end
+
+assert('Array.[]', '15.2.12.4.1') do
+ Array.[](1,2,3) == [1, 2, 3]
+end
+
+assert('Array#*', '15.2.12.5.1') do
+ [1].*(3) == [1, 1, 1]
+end
+
+assert('Array#+', '15.2.12.5.2') do
+ [1].+([1]) == [1, 1]
+end
+
+assert('Array#<<', '15.2.12.5.3') do
+ [1].<<(1) == [1, 1]
+end
+
+assert('Array#[]', '15.2.12.5.4') do
+ [1,2,3].[](1) == 2
+end
+
+assert('Array#[]=', '15.2.12.5.5') do
+ [1,2,3].[]=(1,4) == [1, 4, 3]
+end
+
+assert('Array#clear', '15.2.12.5.6') do
+ a = [1]
+ a.clear
+ a == []
+end
+
+# Not ISO specified
+
+