From: Robert Klemme Date: 2005-02-09T18:05:06+09:00 Subject: Re: Map keys and values behavior "Thomas E Enebo" schrieb im Newsbeitrag news:20050208180232.GH20797@garnet.tc.umn.edu... > I am working on the JRuby project and I was running some of the tests > in samples/test.rb from main ruby-1.8.1 source. I ran across something > which seems like a bug to me (in the test). It is something like: > > $y = {1, 2, 2, 4, 3, 6} > test_ok($y.keys, [1,2,3]) > test_ok($y.values, [2,4,6]) > > Does ruby Maps really return keys and values in order of insertion? No. > That seems strange to me. Seems like the tests are missing a sort. Yes. Or you do a more complex type of test that ensures that all values from the test array are contained in #values. Kind regards robert