[ruby-trunk - Bug #5535][Open] test/psych/test yamldbm.rb, test/syck/test yamldbm.rb のDBM内部構造の順序に依存し

Issue #5535 has been reported by Naohisa G…


Bug #5535: test/psych/test_yamldbm.rb, test/syck/test_yamldbm.rb
のDBM内部構造の順序に依存したテストがFailure
http://redmine.ruby-lang.org/issues/5535

Author: Naohisa G.
Status: Open
Priority: Normal
Assignee:
Category: test
Target version:
ruby -v: ruby 2.0.0dev (2011-11-01) [x86_64-linux]

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”]>.

Issue #5535 has been updated by Naohisa G…

File 20111101-yamldbm-order.patch added

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

Bug #5535: test/psych/test_yamldbm.rb, test/syck/test_yamldbm.rb
のDBM内部構造の順序に依存したテストがFailure
http://redmine.ruby-lang.org/issues/5535

Author: Naohisa G.
Status: Open
Priority: Normal
Assignee:
Category: test
Target version:
ruby -v: ruby 2.0.0dev (2011-11-01) [x86_64-linux]

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”]>.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs