1 (* Regression test for bug in concatenation found by Phil Tomson.
11 let bs_256 = ones_bitstring 256 in
12 assert (bitstring_length bs_256 = 256);
17 (subbitstring bs_256 0 66) : 66 : bitstring
19 let len = bitstring_length bs2 in
21 eprintf "invalid length of bs2: len = %d, expected 67\n" len;
22 hexdump_bitstring stderr bs2;
29 (subbitstring bs_256 0 66) : 66 : bitstring;
30 (subbitstring bs_256 66 67) : 67 : bitstring
32 let len = bitstring_length bs3 in
34 eprintf "invalid length of bs3: len = %d, expected 134\n" len;
35 hexdump_bitstring stderr bs3;
41 (subbitstring bs_256 66 67) : 67 : bitstring
43 let len = bitstring_length bs4 in
45 eprintf "invalid length of bs4: len = %d, expected 67\n" len;
46 hexdump_bitstring stderr bs4;
50 let bs5 = concat [subbitstring bs_256 0 66; subbitstring bs_256 66 67] in
51 let len = bitstring_length bs5 in
53 eprintf "invalid length of bs5: len = %d, expected 133\n" len;
54 hexdump_bitstring stderr bs5;
58 let bs6 = concat [ subbitstring bs_256 0 64; subbitstring bs_256 64 64] in
59 let len = bitstring_length bs6 in
61 eprintf "invalid length of bs6: len = %d, expected 128\n" len;
62 hexdump_bitstring stderr bs6;
66 let bs7 = concat [ subbitstring bs_256 0 65; subbitstring bs_256 65 64] in
67 let len = bitstring_length bs7 in
69 eprintf "invalid length of bs7: len = %d, expected 129\n" len;
70 hexdump_bitstring stderr bs7;
74 if !errors <> 0 then exit 1