Persistent patterns, save and load to a file.
[ocaml-bitstring.git] / tests / 51_open_pattern.ml
diff --git a/tests/51_open_pattern.ml b/tests/51_open_pattern.ml
new file mode 100644 (file)
index 0000000..3e05005
--- /dev/null
@@ -0,0 +1,17 @@
+(* Open a persistent pattern
+ * $Id$
+ *)
+
+open Printf
+open Bitmatch
+
+open bitmatch "tests/test.bmpp"
+
+let () =
+  let bits = bitstring_of_string "\022Mary had a little lamb" in
+  bitmatch bits with
+  | { :pascal_string } ->
+      () (*printf "it's a Pascal string, len = %d, string = %S\n" len str*)
+  | { _ } ->
+      eprintf "not matching error\n";
+      exit 1