Project

General

Profile

Actions

Bug #5535

closed

test/psych/test_yamldbm.rb, test/syck/test_yamldbm.rb のDBM内部構造の順序に依存したテストがFailure

Added by ngoto (Naohisa Goto) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0dev (2011-11-01) [x86_64-linux]
Backport:
[ruby-dev:44763]

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に順序に関する記述は無い。)

  1. Failure:
    test_values(Syck::YAMLDBMTest) [/XXX/test/syck/test_yamldbm.rb:169]:
    <["b", "d"]> expected but was
    <["d", "b"]>.

  2. Failure:
    test_to_a(Syck::YAMLDBMTest) [/XXX/test/syck/test_yamldbm.rb:51]:
    <[["a", "b"], ["c", "d"]]> expected but was
    <[["c", "d"], ["a", "b"]]>.

  3. Failure:
    test_shift(Syck::YAMLDBMTest) [/XXX/test/syck/test_yamldbm.rb:100]:
    <["a", "b"]> expected but was
    <["c", "d"]>.

  4. Failure:
    test_values(Psych::YAMLDBMTest) [/XXX/test/psych/test_yamldbm.rb:169]:
    <["b", "d"]> expected but was
    <["d", "b"]>.

  5. Failure:
    test_to_a(Psych::YAMLDBMTest) [/XXX/test/psych/test_yamldbm.rb:51]:
    <[["a", "b"], ["c", "d"]]> expected but was
    <[["c", "d"], ["a", "b"]]>.

  6. Failure:
    test_shift(Psych::YAMLDBMTest) [/XXX/test/psych/test_yamldbm.rb:100]:
    <["a", "b"]> expected but was
    <["c", "d"]>.


Files

20111101-yamldbm-order.patch (1.99 KB) 20111101-yamldbm-order.patch ngoto (Naohisa Goto), 11/01/2011 10:10 PM

Updated by ngoto (Naohisa Goto) over 12 years ago

添付のパッチのように返り値をソートするとFailureは消えます。

Actions #2

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.
Actions

Also available in: Atom PDF

Like0
Like0Like0