1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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
This commit is contained in:
Kazuki Yamaguchi 2020-04-22 21:46:39 +09:00
parent ffc01afc47
commit 0c66784602
Notes: git 2021-03-16 20:38:56 +09:00

View file

@ -151,7 +151,7 @@ __EOC__
# 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"])