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

ruby-changes:55751

From: Nobuyoshi <ko1@a...>
Date: Sat, 18 May 2019 09:41:39 +0900 (JST)
Subject: [ruby-changes:55751] Nobuyoshi Nakada: 6ae1c596f0 (trunk): Add test for UNTIL

https://git.ruby-lang.org/ruby.git/commit/?id=6ae1c596f0

From 6ae1c596f0b179f1b1b2b115ca75eab1631230fe Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 18 May 2019 09:40:52 +0900
Subject: Add test for UNTIL


diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 7809be0..e7826537 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -290,4 +290,16 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L290
     type2 = body.children[2]
     assert_not_equal(type1, type2)
   end
+
+  def test_until
+    node = RubyVM::AbstractSyntaxTree.parse('1 until 1')
+    _, _, body = *node.children
+    assert_equal(:UNTIL, body.type)
+    type1 = body.children[2]
+    node = RubyVM::AbstractSyntaxTree.parse('begin 1 end until 1')
+    _, _, body = *node.children
+    assert_equal(:UNTIL, body.type)
+    type2 = body.children[2]
+    assert_not_equal(type1, type2)
+  end
 end
-- 
cgit v0.10.2


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

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