Skip to content

Commit c600b1f

Browse files
committed
smaller diff
1 parent 6c39c33 commit c600b1f

File tree

6 files changed

+8
-35
lines changed

6 files changed

+8
-35
lines changed

src/core/QCheck.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let string_fold_right f s acc =
9292
let rec loop i acc =
9393
if i<0
9494
then acc
95-
else loop (i-1) (f (String.get s i) acc) in
95+
else loop (i-1) (f s.[i] acc) in
9696
loop (len-1) acc
9797

9898
exception No_example_found of string
@@ -382,9 +382,8 @@ module Gen = struct
382382
let string_of gen = string_size ~gen nat
383383
let bytes_printable = bytes_size ~gen:printable nat
384384
let string_printable = string_size ~gen:printable nat
385-
let bytes_readable = bytes_printable
386385
let string_readable = string_printable
387-
let small_bytes ?gen st = bytes_size ?gen small_nat st
386+
let bytes_small ?gen st = bytes_size ?gen small_nat st
388387
let small_string ?gen st = string_size ?gen small_nat st
389388
let small_list gen = list_size small_nat gen
390389
let small_array gen = array_size small_nat gen

src/core/QCheck.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ module Gen : sig
417417
(** Generator using the {!printable} character generator.
418418
@since NEXT_RELEASE *)
419419

420-
val small_bytes : ?gen:char t -> bytes t
420+
val bytes_small : ?gen:char t -> bytes t
421421
(** Builds a bytes generator, length is {!small_nat}
422422
Accepts an optional character generator (the default is {!char}).
423423
@since NEXT_RELEASE *)

src/core/QCheck2.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ module Observable = struct
991991

992992
let bool : bool t = (=)
993993

994-
let float = (=)
994+
let float : float t = (=)
995995

996996
let unit () () = true
997997

@@ -1518,7 +1518,6 @@ module Test = struct
15181518
let make_neg = make' ~negative:true
15191519

15201520
let test_get_count (Test cell) = get_count cell
1521-
15221521
let test_get_long_factor (Test cell) = get_long_factor cell
15231522

15241523
(** {6 Running the test} *)

test/core/QCheck2_expect_test.expected.64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ stats len:
819819
8982..9480: 16
820820
9481..9979: 12
821821

822-
+++ Stats for small_bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
822+
+++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
823823

824824
stats len:
825825
num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99

test/core/QCheck_expect_test.expected.64

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -758,32 +758,7 @@ stats len:
758758
9000.. 9499: 13
759759
9500.. 9999: 13
760760

761-
+++ Stats for printable_bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
762-
763-
stats len:
764-
num: 5000, avg: 384.53, stddev: 1330.61, median 9, min 0, max 9969
765-
0.. 498: ####################################################### 4246
766-
499.. 997: ###### 518
767-
998..1496: 21
768-
1497..1995: 10
769-
1996..2494: 11
770-
2495..2993: 10
771-
2994..3492: 13
772-
3493..3991: 13
773-
3992..4490: 5
774-
4491..4989: 10
775-
4990..5488: 19
776-
5489..5987: 9
777-
5988..6486: 10
778-
6487..6985: 12
779-
6986..7484: 17
780-
7485..7983: 16
781-
7984..8482: 16
782-
8483..8981: 16
783-
8982..9480: 16
784-
9481..9979: 12
785-
786-
+++ Stats for small_bytes len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
761+
+++ Stats for bytes_small len dist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
787762

788763
stats len:
789764
num: 5000, avg: 15.57, stddev: 24.36, median 6, min 0, max 99
@@ -1419,7 +1394,7 @@ stats dist:
14191394
4150517416584649600.. 4611686018427387903: ################# 189
14201395
================================================================================
14211396
1 warning(s)
1422-
failure (63 tests failed, 3 tests errored, ran 149 tests)
1397+
failure (63 tests failed, 3 tests errored, ran 148 tests)
14231398
random seed: 153870556
14241399

14251400
+++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

test/core/QCheck_tests.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ module Stats = struct
882882
Test.make ~name:"bytes_size len dist" ~count:5_000 (add_stat len (bytes_of_size (Gen.int_range 5 10))) (fun _ -> true);
883883
Test.make ~name:"bytes len dist" ~count:5_000 (add_stat len bytes) (fun _ -> true);
884884
Test.make ~name:"bytes_of len dist" ~count:5_000 (add_stat len (bytes_gen (Gen.return 'a'))) (fun _ -> true);
885-
Test.make ~name:"small_bytes len dist" ~count:5_000 (add_stat len bytes_small) (fun _ -> true);
885+
Test.make ~name:"bytes_small len dist" ~count:5_000 (add_stat len bytes_small) (fun _ -> true);
886886
]
887887

888888
let string_len_tests =

0 commit comments

Comments
 (0)