Skip to content

Commit 259e6fd

Browse files
committed
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: 2ad65b5 ("config: support .include directive", 2018-08-16)
1 parent 9ce2ccf commit 259e6fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/openssl/test_config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_s_parse_include
151151
# Include a file by relative path
152152
c1 = OpenSSL::Config.parse(include_file)
153153
assert_equal(["default", "sec-a", "sec-b", "sec-main"], c1.sections.sort)
154-
assert_equal(["file-main", "file-a", "file-b"], c1["default"].keys)
154+
assert_equal(["file-a", "file-b", "file-main"], c1["default"].keys.sort)
155155
assert_equal({"a" => "123"}, c1["sec-a"])
156156
assert_equal({"b" => "123"}, c1["sec-b"])
157157
assert_equal({"main" => "123", "key_outside_section" => "value_a"}, c1["sec-main"])

0 commit comments

Comments
 (0)