ruby-changes:65476
From: Kazuki <ko1@a...>
Date: Tue, 16 Mar 2021 20:38:38 +0900 (JST)
Subject: [ruby-changes:65476] 0c66784602 (master): [ruby/openssl] test/openssl/test_config: fix non-deterministic test case
https://git.ruby-lang.org/ruby.git/commit/?id=0c66784602 From 0c66784602048fb4724e8d37038a0e6799f55d46 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi <k@r...> Date: Wed, 22 Apr 2020 21:46:39 +0900 Subject: [ruby/openssl] test/openssl/test_config: fix non-deterministic test case Sort keys of a section before comparing. The ordering is not part of the API. This can cause a test failure if we use OpenSSL's C implementation. Fixes: 2ad65b5f673f ("config: support .include directive", 2018-08-16) https://github.com/ruby/openssl/commit/259e6fd2dc --- test/openssl/test_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/openssl/test_config.rb b/test/openssl/test_config.rb index 9a3a6a8..a725add 100644 --- a/test/openssl/test_config.rb +++ b/test/openssl/test_config.rb @@ -151,7 +151,7 @@ __EOC__ https://github.com/ruby/ruby/blob/trunk/test/openssl/test_config.rb#L151 # Include a file by relative path c1 = OpenSSL::Config.parse(include_file) assert_equal(["default", "sec-a", "sec-b", "sec-main"], c1.sections.sort) - assert_equal(["file-main", "file-a", "file-b"], c1["default"].keys) + assert_equal(["file-a", "file-b", "file-main"], c1["default"].keys.sort) assert_equal({"a" => "123"}, c1["sec-a"]) assert_equal({"b" => "123"}, c1["sec-b"]) assert_equal({"main" => "123", "key_outside_section" => "value_a"}, c1["sec-main"]) -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/