git.annexia.org
/
ocaml-bitstring.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Polymorphic 'field' type.
[ocaml-bitstring.git]
/
tests
/
10_constr1.ml
diff --git
a/tests/10_constr1.ml
b/tests/10_constr1.ml
index
ba7ccc8
..
0a14928
100644
(file)
--- a/
tests/10_constr1.ml
+++ b/
tests/10_constr1.ml
@@
-1,15
+1,15
@@
(* Test a simple constructor.
(* Test a simple constructor.
- * $Id: 10_constr1.ml,v 1.
1 2008-04-01 17:05:37
rjones Exp $
+ * $Id: 10_constr1.ml,v 1.
2 2008-04-25 11:08:43
rjones Exp $
*)
*)
-let bits = BITSTRING
0xc : 4; 0xf : 4; 0xc : 4; 0xf : 4
;;
+let bits = BITSTRING
{ 0xc : 4; 0xf : 4; 0xc : 4; 0xf : 4 }
;;
assert (bits = Bitmatch.make_bitstring 16 '\xcf') ;;
let () =
bitmatch bits with
assert (bits = Bitmatch.make_bitstring 16 '\xcf') ;;
let () =
bitmatch bits with
- | n0 : 4; n1 : 4; n2 : 4; n3 : 4;
-
rest : -1 : bitstring
->
+ |
{
n0 : 4; n1 : 4; n2 : 4; n3 : 4;
+
rest : -1 : bitstring }
->
assert (n0 = 0xc);
assert (n1 = 0xf);
assert (n2 = 0xc);
assert (n0 = 0xc);
assert (n1 = 0xf);
assert (n2 = 0xc);
@@
-18,5
+18,5
@@
let () =
let _, off, len = rest in
assert (off = 16 && len = 0) (* no further data *)
let _, off, len = rest in
assert (off = 16 && len = 0) (* no further data *)
- |
_
->
+ |
{ _ }
->
failwith "error: did not match\n"
failwith "error: did not match\n"