Skip to content

Commit 33e27a4

Browse files
committed
A more fancy property
1 parent b960869 commit 33e27a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_msb_ndx.erl

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
-include_lib("eqc/include/eqc.hrl").
33
-compile(export_all).
44

5-
prop_zero() ->
5+
prop_msb_ndx() ->
66
?SETUP(fun () -> eqc_c:start(binary16),
77
fun() -> ok end
88
end,
9-
equals(0, binary16:msb_ndx(0))).
9+
?FORALL(Width, choose(0, 32)},
10+
?FORALL(X, choose(1 bsl (Width - 1), (1 bsl Width) - 1),
11+
equals(Width, binary16:msb_ndx(<<X:Width>>))))).

0 commit comments

Comments
 (0)