couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: 160- failure
Date Fri, 25 Mar 2011 10:22:41 GMT
On Fri, Mar 25, 2011 at 10:01 AM, Benoit Chesneau <bchesneau@gmail.com> wrote:
> which may be the result of ets:match. Does anyone know if ets:match is
> expected to return in insertion order ? But this is the reason test is
> failing here I think. Any thoughts ? Anyway  I will post later today a
> test to isolate this behaviour.  maybe it worth a ticket too.

Benôit, I think it's not ets:match's fault but it's instead because
the ets is of type 'set' which doesn't guarantee retrievel in the same
order as the insertion order:

Eshell V5.8.2  (abort with ^G)
1> T = ets:new(test_ets_foo, [set, private]).
16400
2> ets:insert(T, {b, 2}).
true
3> ets:insert(T, {a, 1}).
true
4> ets:tab2list(T).
[{b,2},{a,1}]
5> ets:insert(T, {x, 3}).
true
6> ets:tab2list(T).
[{x,3},{b,2},{a,1}]
7>


>
> - benoit
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Mime
View raw message