[前][次][番号順一覧][スレッド一覧]

ruby-changes:44226

From: nobu <ko1@a...>
Date: Fri, 30 Sep 2016 21:47:00 +0900 (JST)
Subject: [ruby-changes:44226] nobu:r56299 (trunk): test_flip.rb: add

nobu	2016-09-30 21:46:53 +0900 (Fri, 30 Sep 2016)

  New Revision: 56299

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56299

  Log:
    test_flip.rb: add
    
    * test/ruby/test_flip.rb (test_flip_flop): basic test.

  Modified files:
    trunk/test/ruby/test_flip.rb
Index: test/ruby/test_flip.rb
===================================================================
--- test/ruby/test_flip.rb	(revision 56298)
+++ test/ruby/test_flip.rb	(revision 56299)
@@ -2,6 +2,11 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_flip.rb#L2
 require 'test/unit'
 
 class TestFlip < Test::Unit::TestCase
+  def test_flip_flop
+    assert_equal [2], (1..9).select {|n| true if (n==2)..(n%2).zero?}
+    assert_equal [2,3,4], (1..9).select {|n| true if (n==2)...(n%2).zero?}
+  end
+
   def test_hidden_key
     bug6899 = '[ruby-core:47253]'
     foo = "foor"

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]