File: test_bit_vector.ml

package info (click to toggle)
ocaml-re 1.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 848 kB
  • sloc: ml: 8,054; makefile: 18; sh: 11
file content (26 lines) | stat: -rw-r--r-- 530 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
open! Import
module Bit_vector = Re_private.Bit_vector

let%expect_test "reset_zero" =
  let n = Bit_vector.create_zero 10 in
  let print () = Format.printf "%a@." Bit_vector.pp n in
  print ();
  [%expect {|
    (len 10)
    (bits "\000\000") |}];
  Bit_vector.reset_zero n;
  print ();
  [%expect {|
    (len 10)
    (bits "\000\000") |}];
  Bit_vector.set n 1 true;
  print ();
  [%expect {|
    (len 10)
    (bits "\002\000") |}];
  Bit_vector.reset_zero n;
  print ();
  [%expect {|
    (len 10)
    (bits "\000\000") |}]
;;