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

ruby-changes:51015

From: kou <ko1@a...>
Date: Sat, 21 Apr 2018 15:44:03 +0900 (JST)
Subject: [ruby-changes:51015] kou:r63222 (trunk): rexml: Fix XPath concat() implementation

kou	2018-04-21 15:43:58 +0900 (Sat, 21 Apr 2018)

  New Revision: 63222

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

  Log:
    rexml: Fix XPath concat() implementation
    
    * lib/rexml/functions.rb (REXML::Functions.concat): Implement.
    
    * test/rexml/test_jaxen.rb: Enable one more test.

  Modified files:
    trunk/lib/rexml/functions.rb
    trunk/test/rexml/test_jaxen.rb
Index: test/rexml/test_jaxen.rb
===================================================================
--- test/rexml/test_jaxen.rb	(revision 63221)
+++ test/rexml/test_jaxen.rb	(revision 63222)
@@ -30,7 +30,7 @@ module REXMLTests https://github.com/ruby/ruby/blob/trunk/test/rexml/test_jaxen.rb#L30
     def _test_numbers ; process_test_case("numbers") ; end
     def test_pi ; process_test_case("pi") ; end
     def _test_pi2 ; process_test_case("pi2") ; end
-    def _test_simple ; process_test_case("simple") ; end
+    def test_simple ; process_test_case("simple") ; end
     def _test_testNamespaces ; process_test_case("testNamespaces") ; end
     def _test_text ; process_test_case("text") ; end
     def _test_underscore ; process_test_case("underscore") ; end
Index: lib/rexml/functions.rb
===================================================================
--- lib/rexml/functions.rb	(revision 63221)
+++ lib/rexml/functions.rb	(revision 63222)
@@ -186,9 +186,12 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/functions.rb#L186
       rv
     end
 
-    # UNTESTED
     def Functions::concat( *objects )
-      objects.join
+      concatenated = ""
+      objects.each do |object|
+        concatenated << string(object)
+      end
+      concatenated
     end
 
     # Fixed by Mike Stok

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

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