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

ruby-changes:41327

From: nobu <ko1@a...>
Date: Fri, 1 Jan 2016 08:53:23 +0900 (JST)
Subject: [ruby-changes:41327] nobu:r53399 (trunk): Add test for Enumerator::Lazy#take

nobu	2016-01-01 08:53:04 +0900 (Fri, 01 Jan 2016)

  New Revision: 53399

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

  Log:
    Add test for Enumerator::Lazy#take
    
    * test/ruby/test_lazy_enumerator.rb (test_take_bad_arg): Add test
      code in case of Enumerator::Lazy#take called with negative number.
      [ruby-dev:49467] [Bug #11933]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_lazy_enumerator.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53398)
+++ ChangeLog	(revision 53399)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jan  1 08:53:02 2016  Yuki Kurihara  <co000ri@g...>
+
+	* test/ruby/test_lazy_enumerator.rb (test_take_bad_arg): Add test
+	  code in case of Enumerator::Lazy#take called with negative number.
+	  [ruby-dev:49467] [Bug #11933]
+
 Fri Jan  1 05:06:20 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (parser_here_document): update indent for each line in
Index: test/ruby/test_lazy_enumerator.rb
===================================================================
--- test/ruby/test_lazy_enumerator.rb	(revision 53398)
+++ test/ruby/test_lazy_enumerator.rb	(revision 53399)
@@ -275,6 +275,11 @@ class TestLazyEnumerator < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lazy_enumerator.rb#L275
     assert_equal(nil, a.current)
   end
 
+  def test_take_bad_arg
+    a = Step.new(1..10)
+    assert_raise(ArgumentError) { a.lazy.take(-1) }
+  end
+
   def test_take_recycle
     bug6428 = '[ruby-dev:45634]'
     a = Step.new(1..10)

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

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