Bug #5535
closedtest/psych/test_yamldbm.rb, test/syck/test_yamldbm.rb のDBM内部構造の順序に依存したテストがFailure
Description
x86_64-linux, sparc-solaris2.10 での make test-all にて、以下のFailureが出ます。
YAML::DBM#shift の rdoc によると、
The order in which values are removed/returned is not guaranteed.
順序が不定であると明記されていますが、テストは特定の順序に依存して書かれているのが原因のようです。
YAML::DBM#to_a, YAML::DBM#values のテストも同様です。(ただしrdocに順序に関する記述は無い。)
-
Failure:
test_values(Syck::YAMLDBMTest) [/XXX/test/syck/test_yamldbm.rb:169]:
<["b", "d"]> expected but was
<["d", "b"]>. -
Failure:
test_to_a(Syck::YAMLDBMTest) [/XXX/test/syck/test_yamldbm.rb:51]:
<[["a", "b"], ["c", "d"]]> expected but was
<[["c", "d"], ["a", "b"]]>. -
Failure:
test_shift(Syck::YAMLDBMTest) [/XXX/test/syck/test_yamldbm.rb:100]:
<["a", "b"]> expected but was
<["c", "d"]>. -
Failure:
test_values(Psych::YAMLDBMTest) [/XXX/test/psych/test_yamldbm.rb:169]:
<["b", "d"]> expected but was
<["d", "b"]>. -
Failure:
test_to_a(Psych::YAMLDBMTest) [/XXX/test/psych/test_yamldbm.rb:51]:
<[["a", "b"], ["c", "d"]]> expected but was
<[["c", "d"], ["a", "b"]]>. -
Failure:
test_shift(Psych::YAMLDBMTest) [/XXX/test/psych/test_yamldbm.rb:100]:
<["a", "b"]> expected but was
<["c", "d"]>.
Files
Updated by ngoto (Naohisa Goto) over 12 years ago
添付のパッチのように返り値をソートするとFailureは消えます。
Updated by ayumin (Ayumu AIZAWA) over 12 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r33610.
Naohisa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- test/psych/test_yamldbm.rb: avoid platform dependency.
patch by Naohisa Goto. [ruby-dev:44763] [Bug #5535] - test/syck/test_yamldbm.rb: ditto.