git.annexia.org
/
ocaml-bitstring.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
In a '{...} as foo' binding, save the original bitstring offset and
[ocaml-bitstring.git]
/
tests
/
test_90_bind_as.ml
1
(* Regression test for bug in 'as-binding' found by Matej Kosik.
2
* $Id$
3
*)
4
5
open Printf
6
open Bitstring
7
8
let bits = Bitstring.ones_bitstring 1 in
9
bitmatch bits with
10
| { _ : 1 } as foo ->
11
let len = Bitstring.bitstring_length foo in
12
if len <> 1 then (
13
hexdump_bitstring stderr foo;
14
eprintf "test error: length = %d, expecting 1\n" len;
15
exit 1
16
)
17
| { _ } ->
18
assert false