[macruby-changes] [4583] MacRuby/trunk/spec/macruby
source_changes at macosforge.org
source_changes at macosforge.org
Wed Oct 6 14:49:59 PDT 2010
Revision: 4583
http://trac.macosforge.org/projects/ruby/changeset/4583
Author: lsansonetti at apple.com
Date: 2010-10-06 14:49:57 -0700 (Wed, 06 Oct 2010)
Log Message:
-----------
add a test for mri abi functions of arity 6
Modified Paths:
--------------
MacRuby/trunk/spec/macruby/core/mri_abi_spec.rb
MacRuby/trunk/spec/macruby/fixtures/mri_abi.m
Modified: MacRuby/trunk/spec/macruby/core/mri_abi_spec.rb
===================================================================
--- MacRuby/trunk/spec/macruby/core/mri_abi_spec.rb 2010-10-06 21:48:55 UTC (rev 4582)
+++ MacRuby/trunk/spec/macruby/core/mri_abi_spec.rb 2010-10-06 21:49:57 UTC (rev 4583)
@@ -46,6 +46,16 @@
@o.test_arity5(arg1, arg2, arg3, arg4, arg5).should == @helper[@o, arg1, arg2, arg3, arg4, arg5]
end
+ it "with arity 6 can be called" do
+ arg1 = Object.new
+ arg2 = Object.new
+ arg3 = Object.new
+ arg4 = Object.new
+ arg5 = Object.new
+ arg6 = Object.new
+ @o.test_arity6(arg1, arg2, arg3, arg4, arg5, arg6).should == @helper[@o, arg1, arg2, arg3, arg4, arg5, arg6]
+ end
+
it "with arity -1 can be called" do
arg1 = Object.new
arg2 = Object.new
Modified: MacRuby/trunk/spec/macruby/fixtures/mri_abi.m
===================================================================
--- MacRuby/trunk/spec/macruby/fixtures/mri_abi.m 2010-10-06 21:48:55 UTC (rev 4582)
+++ MacRuby/trunk/spec/macruby/fixtures/mri_abi.m 2010-10-06 21:49:57 UTC (rev 4583)
@@ -65,6 +65,19 @@
}
static VALUE
+test_arity6(VALUE rcv, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6)
+{
+ VALUE str = ocid_str(rcv);
+ rb_str_concat(str, ocid_str(arg1));
+ rb_str_concat(str, ocid_str(arg2));
+ rb_str_concat(str, ocid_str(arg3));
+ rb_str_concat(str, ocid_str(arg4));
+ rb_str_concat(str, ocid_str(arg5));
+ rb_str_concat(str, ocid_str(arg6));
+ return str;
+}
+
+static VALUE
test_arity_m1(int argc, VALUE *argv, VALUE rcv)
{
VALUE str = ocid_str(rcv);
@@ -96,6 +109,7 @@
rb_define_method(klass, "test_arity3", test_arity3, 3);
rb_define_method(klass, "test_arity4", test_arity4, 4);
rb_define_method(klass, "test_arity5", test_arity5, 5);
+ rb_define_method(klass, "test_arity6", test_arity6, 6);
rb_define_method(klass, "test_arity_m1", test_arity_m1, -1);
rb_define_method(klass, "test_arity_m2", test_arity_m2, -2);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101006/f073b0b8/attachment.html>
More information about the macruby-changes
mailing list