yarv-diff:239
From: ko1 atdot.net
Date: 13 Feb 2006 16:25:15 -0000
Subject: [yarv-diff:239] r402 - in trunk: . test/ruby
Author: aamine
Date: 2006-02-14 01:25:14 +0900 (Tue, 14 Feb 2006)
New Revision: 402
Removed:
trunk/test/ruby/test_lambda.rb
Modified:
trunk/ChangeLog
Log:
* test/ruby/test_lambda.rb: removed (->(){...} syntax is obsolete).
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-02-13 16:21:14 UTC (rev 401)
+++ trunk/ChangeLog 2006-02-13 16:25:14 UTC (rev 402)
@@ -4,6 +4,12 @@
# from Mon, 03 May 2004 01:24:19 +0900
#
+2006-02-14(Tue) 01:24:56 +0900 Minero Aoki <aamine loveruby.net>
+
+ * test/ruby/test_lambda.rb: removed (->(){...} syntax is
+ obsolete).
+
+
2006-02-14(Tue) 01:20:54 +0900 Minero Aoki <aamine loveruby.net>
* test/ruby/test_module.rb: import many tests from rubicon.
Deleted: trunk/test/ruby/test_lambda.rb
===================================================================
--- trunk/test/ruby/test_lambda.rb 2006-02-13 16:21:14 UTC (rev 401)
+++ trunk/test/ruby/test_lambda.rb 2006-02-13 16:25:14 UTC (rev 402)
@@ -1,59 +0,0 @@
-require 'test/unit'
-
-class TestLambdaParameters < Test::Unit::TestCase
-
- def test_dummy
- assert(false, "Syntax '->(){}' is not supported on YARV")
- end
-=begin
- def test_call_simple
- assert_equal(1, ->(a){ a }.call(1))
- assert_equal([1,2], ->(a,b){ [a,b] }.call(1,2))
- assert_raises(ArgumentError) { ->(a){ }.call(1,2) }
- assert_raises(ArgumentError) { ->(a){ }.call() }
- assert_raises(ArgumentError) { ->(){ }.call(1) }
- assert_raises(ArgumentError) { ->(a,b){ }.call(1,2,3) }
- end
-
- def test_call_rest_args
- assert_equal([1,2], ->(*a){ a }.call(1,2))
- assert_equal([1,2,[]], ->(a,b,*c){ [a,b,c] }.call(1,2))
- assert_raises(ArgumentError){ ->(a,*b){ }.call() }
- end
-
- def test_call_opt_args
- assert_equal([1,2,3,4], ->(a,b,c=3,d=4){ [a,b,c,d] }.call(1,2))
- assert_equal([1,2,3,4], ->(a,b,c=0,d=4){ [a,b,c,d] }.call(1,2,3))
- assert_raises(ArgumentError){ ->(a,b=1){ }.call() }
- assert_raises(ArgumentError){ ->(a,b=1){ }.call(1,2,3) }
- end
-
- def test_call_rest_and_opt
- assert_equal([1,2,3,[]], ->(a,b=2,c=3,*d){ [a,b,c,d] }.call(1))
- assert_equal([1,2,3,[]], ->(a,b=0,c=3,*d){ [a,b,c,d] }.call(1,2))
- assert_equal([1,2,3,[4,5,6]], ->(a,b=0,c=0,*d){ [a,b,c,d] }.call(1,2,3,4,5,6))
- assert_raises(ArgumentError){ ->(a,b=1,*c){ }.call() }
- end
-
- def test_call_with_block
- f = ->(a,b,c=3,*d,&e){ [a,b,c,d,e.call(d + [a,b,c])] }
- assert_equal([1,2,3,[],6], f.call(1,2){|z| z.inject{|s,x| s+x} } )
- assert_equal(nil, ->(&b){ b }.call)
- foo { puts "bogus block " }
- assert_equal(1, ->(&b){ b.call }.call { 1 })
- b = nil
- assert_equal(1, ->(&b){ b.call }.call { 1 })
- assert_nil(b)
- end
-
- def foo
- assert_equal(nil, ->(&b){ b }.call)
- end
-
- def test_lambda_as_iterator
- a = 0
- 2.times ->(_){ a += 1 }
- assert_equal(a, 2)
- end
-=end
-end
--
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml