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

ruby-changes:66232

From: Yusuke <ko1@a...>
Date: Mon, 17 May 2021 14:31:52 +0900 (JST)
Subject: [ruby-changes:66232] 31a757a442 (master): Make the test pass with the old libyaml

https://git.ruby-lang.org/ruby.git/commit/?id=31a757a442

From 31a757a4426f1ac8c479313e01542940386fc2fe Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Mon, 17 May 2021 14:22:42 +0900
Subject: Make the test pass with the old libyaml

I have no idea what result is right, but it fails with libyaml 0.1.7
(bundled with Ubuntu 18.04) anyway.
---
 test/psych/test_coder.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/psych/test_coder.rb b/test/psych/test_coder.rb
index 1c14459..f6840ab 100644
--- a/test/psych/test_coder.rb
+++ b/test/psych/test_coder.rb
@@ -274,7 +274,7 @@ module Psych https://github.com/ruby/ruby/blob/trunk/test/psych/test_coder.rb#L274
 
     def test_coder_style_scalar_default
       foo = Psych.dump 'some scalar'
-      assert_equal "--- some scalar\n", foo
+      assert_match /\A--- some scalar\n(?:\.\.\.\n)?\z/, foo
     end
 
     def test_coder_style_scalar_any
@@ -282,7 +282,7 @@ module Psych https://github.com/ruby/ruby/blob/trunk/test/psych/test_coder.rb#L282
         scalar: 'some scalar',
         style: Psych::Nodes::Scalar::ANY,
         tag: nil
-      assert_equal "--- some scalar\n", foo
+      assert_match /\A--- some scalar\n(?:\.\.\.\n)?\z/, foo
     end
 
     def test_coder_style_scalar_plain
@@ -290,7 +290,7 @@ module Psych https://github.com/ruby/ruby/blob/trunk/test/psych/test_coder.rb#L290
         scalar: 'some scalar',
         style: Psych::Nodes::Scalar::PLAIN,
         tag: nil
-      assert_equal "--- some scalar\n", foo
+      assert_match /\A--- some scalar\n(?:\.\.\.\n)?\z/, foo
     end
 
     def test_coder_style_scalar_single_quoted
-- 
cgit v1.1


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

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