summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-30 12:46:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-30 12:46:53 +0000
commited2af78b67333c419ba051e27fb7e34e8876edf0 (patch)
tree588850632325968eaf3bf2f64270358c3adf5384 /test
parent107ba65fba13bdf791e5dae0305c5768e6f7d122 (diff)
test_flip.rb: add
* test/ruby/test_flip.rb (test_flip_flop): basic test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_flip.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_flip.rb b/test/ruby/test_flip.rb
index 0f2ae09e18..11f387d7ac 100644
--- a/test/ruby/test_flip.rb
+++ b/test/ruby/test_flip.rb
@@ -2,6 +2,11 @@
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"