[macruby-changes] [2527] MacRuby/trunk/test_vm

source_changes at macosforge.org source_changes at macosforge.org
Wed Sep 9 04:59:30 PDT 2009


Revision: 2527
          http://trac.macosforge.org/projects/ruby/changeset/2527
Author:   vincent.isambart at gmail.com
Date:     2009-09-09 04:59:27 -0700 (Wed, 09 Sep 2009)
Log Message:
-----------
added tests for using a keyword as a key in a hash
(reported in the ticket #328 http://www.macruby.org/trac/ticket/328)

Modified Paths:
--------------
    MacRuby/trunk/test_vm/literal.rb
    MacRuby/trunk/test_vm/method.rb

Modified: MacRuby/trunk/test_vm/literal.rb
===================================================================
--- MacRuby/trunk/test_vm/literal.rb	2009-09-09 07:17:21 UTC (rev 2526)
+++ MacRuby/trunk/test_vm/literal.rb	2009-09-09 11:59:27 UTC (rev 2527)
@@ -6,6 +6,7 @@
 assert 'nil', "a=[]; p a[42]"
 
 assert "{}", "h={}; p h"
+assert "{:in=>42}", "h={in: 42}; p h"
 assert "3", "h={:un=>1,:deux=>2}; p h[:un]+h[:deux]"
 
 assert '"foo246bar"', "p \"foo#{1+1}#{2+2}#{3+3}bar\""
@@ -31,4 +32,4 @@
 
 assert '424242', "a=''; 3.times { b=''; b << '42'; a<<b }; p a.to_i"
 
-assert '42', 'p -> { 42 }.call'
\ No newline at end of file
+assert '42', 'p -> { 42 }.call'

Modified: MacRuby/trunk/test_vm/method.rb
===================================================================
--- MacRuby/trunk/test_vm/method.rb	2009-09-09 07:17:21 UTC (rev 2526)
+++ MacRuby/trunk/test_vm/method.rb	2009-09-09 11:59:27 UTC (rev 2527)
@@ -59,3 +59,8 @@
   def foo; p 42; end
   foo(*[])
 }
+
+assert '42', %{
+  def f(args) p args[:in] end
+  f(in: 42)
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090909/008b167e/attachment.html>


More information about the macruby-changes mailing list