Bug #5535 » 20111101-yamldbm-order.patch
test/psych/test_yamldbm.rb (working copy) | ||
---|---|---|
def test_to_a
|
||
@yamldbm['a'] = 'b'
|
||
@yamldbm['c'] = 'd'
|
||
assert_equal([['a','b'],['c','d']], @yamldbm.to_a)
|
||
assert_equal([['a','b'],['c','d']], @yamldbm.to_a.sort)
|
||
end
|
||
def test_to_hash
|
||
... | ... | |
def test_shift
|
||
@yamldbm['a'] = 'b'
|
||
@yamldbm['c'] = 'd'
|
||
assert_equal(['a','b'], @yamldbm.shift)
|
||
assert_equal(['c','d'], @yamldbm.shift)
|
||
assert_equal([['a','b'], ['c','d']],
|
||
[@yamldbm.shift, @yamldbm.shift].sort)
|
||
assert_nil @yamldbm.shift
|
||
end
|
||
... | ... | |
assert_equal [], @yamldbm.values
|
||
@yamldbm['a'] = 'b'
|
||
@yamldbm['c'] = 'd'
|
||
assert_equal ['b','d'], @yamldbm.values
|
||
assert_equal ['b','d'], @yamldbm.values.sort
|
||
end
|
||
def test_values_at
|
test/syck/test_yamldbm.rb (working copy) | ||
---|---|---|
def test_to_a
|
||
@yamldbm['a'] = 'b'
|
||
@yamldbm['c'] = 'd'
|
||
assert_equal([['a','b'],['c','d']], @yamldbm.to_a)
|
||
assert_equal([['a','b'],['c','d']], @yamldbm.to_a.sort)
|
||
end
|
||
def test_to_hash
|
||
... | ... | |
def test_shift
|
||
@yamldbm['a'] = 'b'
|
||
@yamldbm['c'] = 'd'
|
||
assert_equal(['a','b'], @yamldbm.shift)
|
||
assert_equal(['c','d'], @yamldbm.shift)
|
||
assert_equal([['a','b'], ['c','d']],
|
||
[@yamldbm.shift, @yamldbm.shift].sort)
|
||
assert_nil @yamldbm.shift
|
||
end
|
||
... | ... | |
assert_equal [], @yamldbm.values
|
||
@yamldbm['a'] = 'b'
|
||
@yamldbm['c'] = 'd'
|
||
assert_equal ['b','d'], @yamldbm.values
|
||
assert_equal ['b','d'], @yamldbm.values.sort
|
||
end
|
||
def test_values_at
|