<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 24, 2015 at 3:28 PM, Björn-Egil Dahlberg <span dir="ltr"><<a href="mailto:egil@erlang.org" target="_blank">egil@erlang.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">We will look into the others now.</blockquote></div><br>I extended the tests for the branch egil/fix-term-cmp/OTP-12623 (commit-ID: a1520d8) which fixes the binary_to_term/term_to_binary conversions. I had some model errors with maps:map/2, which I fixed. Then I added generators for floating point values. Look at this little gem:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">Erlang/OTP 17 [erts-6.3.1] [source-a1520d8] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]</div><div class="gmail_extra"><br></div><div class="gmail_extra">Eshell V6.3.1  (abort with ^G)</div><div class="gmail_extra">1> L = [{-1,0},{0.0,0},{0,0},{1,0}].</div><div class="gmail_extra">[{-1,0},{0.0,0},{0,0},{1,0}]</div><div class="gmail_extra">2> lists:sort(L).</div><div class="gmail_extra">[{-1,0},{0.0,0},{0,0},{1,0}]</div><div class="gmail_extra">3> lists:sort(maps:to_list(maps:from_list(L))).</div><div class="gmail_extra">[{-1,0},{0,0},{0.0,0},{1,0}]</div><div class="gmail_extra">4> v(2) =:= v(3).</div><div class="gmail_extra">false</div><div class="gmail_extra"><div class="gmail_extra">5> maps:to_list(maps:from_list(L)).</div><div class="gmail_extra">[{-1,0},{0,0},{1,0},{0.0,0}]</div><div><br></div><div>In other words, factoring L through a map makes the comparison and the sort go wrong. I would expect the factoring to be the identity such that v(4) would be true in the above. But it looks like something happens to the value so 0 and 0.0 swaps place in the ordering. There *has* to be a floating point 0.0 in there. So it has something to do with this, but I can't be more specific :) Note that this bug may be related to the merge bug I reported earlier today, but the merge tests succeed on this branch.</div></div><br clear="all"><div>Also, another peculiar thing:</div><div><br></div><div><div>7> maps:put(-1, 3, #{}). </div><div>#{-1 => 3}</div><div>8> #{ -1 => 3 }.</div><div>* 1: illegal map key</div></div><div><br></div><div>Negative integers are not valid map keys, but I don't know exactly why that is the case. This is compiler-land however, and I have not yet a QuickCheck model for that :)</div><div><br></div><div>Here is the QuickCheck run, including shrinking:</div><div><br></div><div><a href="https://gist.github.com/jlouis/5b4311f40675b1693c84">https://gist.github.com/jlouis/5b4311f40675b1693c84</a><br></div><div><br></div><div><br></div>-- <br><div class="gmail_signature">J.</div>
</div></div>