git.annexia.org
/
ocaml-bitstring.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
566952c
)
Minor code rearrangement, improve an error message.
author
Richard W.M. Jones
<rich@annexia.org>
Sun, 18 May 2008 22:27:25 +0000
(22:27 +0000)
committer
Richard W.M. Jones
<rich@annexia.org>
Sun, 18 May 2008 22:27:25 +0000
(22:27 +0000)
tests/11_match_ints.ml
patch
|
blob
|
history
diff --git
a/tests/11_match_ints.ml
b/tests/11_match_ints.ml
index
c2a2b8b
..
e8f54b9
100644
(file)
--- a/
tests/11_match_ints.ml
+++ b/
tests/11_match_ints.ml
@@
-34,17
+34,16
@@
let () =
let actual =
let rec loop bits =
bitmatch bits with
let actual =
let rec loop bits =
bitmatch bits with
- | { i : bitlen; rest : -1 : bitstring } ->
- if Bitmatch.bitstring_length rest > 0 then
- i :: loop rest
- else
- [i]
+ | { i : bitlen; rest : -1 : bitstring }
+ when Bitmatch.bitstring_length rest = 0 -> [i]
+ | { i : bitlen; rest : -1 : bitstring } -> i :: loop rest
| { _ } ->
failwith (sprintf "loop failed with len = %d, bitlen = %d"
len bitlen)
in
loop bits in
if actual <> expected then
| { _ } ->
failwith (sprintf "loop failed with len = %d, bitlen = %d"
len bitlen)
in
loop bits in
if actual <> expected then
- failwith (sprintf "match bits: failed on 1 bit test, len = %d" len)
+ failwith (sprintf "match ints: failed on test, len = %d, bitlen = %d"
+ len bitlen)
done
done
done
done