Skip to content

Commit e87b7ee

Browse files
authored
Merge pull request #383 from jmid/another-float_exp-test
Expect test `float_exp` on negative inputs too
2 parents 2786121 + d50ada4 commit e87b7ee

10 files changed

+66
-8
lines changed

test/core/QCheck2_expect_test.expected.ocaml4.32

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,12 @@ Test float_exp 10. < Float.pi failed (6 shrink steps):
473473

474474
--- Failure --------------------------------------------------------------------
475475

476+
Test float_exp -10. > -. Float.pi failed (6 shrink steps):
477+
478+
-3.1417780719
479+
480+
--- Failure --------------------------------------------------------------------
481+
476482
Test char never produces 'abcdef' failed (1 shrink steps):
477483

478484
'a'
@@ -2015,7 +2021,7 @@ Collect results for test float classify:
20152021
FP_nan: 2 cases (0.0%)
20162022
================================================================================
20172023
1 warning(s)
2018-
failure (104 tests failed, 3 tests errored, ran 208 tests)
2024+
failure (105 tests failed, 3 tests errored, ran 209 tests)
20192025
random seed: 153870556
20202026

20212027
+++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

test/core/QCheck2_expect_test.expected.ocaml4.64

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,12 @@ Test float_exp 10. < Float.pi failed (6 shrink steps):
535535

536536
--- Failure --------------------------------------------------------------------
537537

538+
Test float_exp -10. > -. Float.pi failed (6 shrink steps):
539+
540+
-3.1417780719
541+
542+
--- Failure --------------------------------------------------------------------
543+
538544
Test char never produces 'abcdef' failed (1 shrink steps):
539545

540546
'a'
@@ -2079,7 +2085,7 @@ Collect results for test float classify:
20792085
FP_nan: 2 cases (0.0%)
20802086
================================================================================
20812087
1 warning(s)
2082-
failure (104 tests failed, 3 tests errored, ran 208 tests)
2088+
failure (105 tests failed, 3 tests errored, ran 209 tests)
20832089
random seed: 153870556
20842090

20852091
+++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

test/core/QCheck2_expect_test.expected.ocaml5.32

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,12 @@ Test float_exp 10. < Float.pi failed (8 shrink steps):
456456

457457
--- Failure --------------------------------------------------------------------
458458

459+
Test float_exp -10. > -. Float.pi failed (8 shrink steps):
460+
461+
-3.14167640757
462+
463+
--- Failure --------------------------------------------------------------------
464+
459465
Test char never produces 'abcdef' failed (1 shrink steps):
460466

461467
'a'
@@ -1999,7 +2005,7 @@ Collect results for test float classify:
19992005
FP_subnormal: 3 cases (0.1%)
20002006
================================================================================
20012007
1 warning(s)
2002-
failure (104 tests failed, 3 tests errored, ran 208 tests)
2008+
failure (105 tests failed, 3 tests errored, ran 209 tests)
20032009
random seed: 153870556
20042010

20052011
+++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

test/core/QCheck2_expect_test.expected.ocaml5.64

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,12 @@ Test float_exp 10. < Float.pi failed (8 shrink steps):
518518

519519
--- Failure --------------------------------------------------------------------
520520

521+
Test float_exp -10. > -. Float.pi failed (8 shrink steps):
522+
523+
-3.14167640757
524+
525+
--- Failure --------------------------------------------------------------------
526+
521527
Test char never produces 'abcdef' failed (1 shrink steps):
522528

523529
'a'
@@ -2061,7 +2067,7 @@ Collect results for test float classify:
20612067
FP_subnormal: 3 cases (0.1%)
20622068
================================================================================
20632069
1 warning(s)
2064-
failure (104 tests failed, 3 tests errored, ran 208 tests)
2070+
failure (105 tests failed, 3 tests errored, ran 209 tests)
20652071
random seed: 153870556
20662072

20672073
+++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

test/core/QCheck2_tests.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ module Shrink = struct
565565
Test.make ~name:"float_exp 10. < Float.pi" ~count:1000 ~print:Print.float
566566
(Gen.float_exp 10.) (fun f -> f < Float.pi)
567567

568+
let float_exp_m10_gt_mpi =
569+
Test.make ~name:"float_exp -10. > -. Float.pi" ~count:1000 ~print:Print.float
570+
(Gen.float_exp (-10.)) (fun f -> f > -. Float.pi)
571+
568572
let char_is_never_abcdef =
569573
Test.make ~name:"char never produces 'abcdef'" ~count:1000 ~print:Print.char
570574
Gen.char (fun c -> not (List.mem c ['a';'b';'c';'d';'e';'f']))
@@ -865,6 +869,7 @@ module Shrink = struct
865869
float_neg_not_nan;
866870
float_neg_not_infinite;
867871
float_exp_10_lt_pi;
872+
float_exp_m10_gt_mpi;
868873
char_is_never_abcdef;
869874
char_printable_is_never_sign;
870875
char_numeral_is_never_less_5;

test/core/QCheck_expect_test.expected.ocaml4.32

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,12 @@ Test float_exp 10. < Float.pi failed (2 shrink steps):
449449

450450
--- Failure --------------------------------------------------------------------
451451

452+
Test float_exp -10. > -. Float.pi failed (2 shrink steps):
453+
454+
-4.
455+
456+
--- Failure --------------------------------------------------------------------
457+
452458
Test char never produces 'abcdef' failed (3 shrink steps):
453459

454460
'a'
@@ -1998,7 +2004,7 @@ Collect results for test float classify:
19982004
FP_nan: 2 cases (0.0%)
19992005
================================================================================
20002006
1 warning(s)
2001-
failure (105 tests failed, 3 tests errored, ran 216 tests)
2007+
failure (106 tests failed, 3 tests errored, ran 217 tests)
20022008
random seed: 153870556
20032009

20042010
+++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

test/core/QCheck_expect_test.expected.ocaml4.64

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,12 @@ Test float_exp 10. < Float.pi failed (2 shrink steps):
481481

482482
--- Failure --------------------------------------------------------------------
483483

484+
Test float_exp -10. > -. Float.pi failed (2 shrink steps):
485+
486+
-4.
487+
488+
--- Failure --------------------------------------------------------------------
489+
484490
Test char never produces 'abcdef' failed (3 shrink steps):
485491

486492
'a'
@@ -2032,7 +2038,7 @@ Collect results for test float classify:
20322038
FP_nan: 2 cases (0.0%)
20332039
================================================================================
20342040
1 warning(s)
2035-
failure (105 tests failed, 3 tests errored, ran 216 tests)
2041+
failure (106 tests failed, 3 tests errored, ran 217 tests)
20362042
random seed: 153870556
20372043

20382044
+++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

test/core/QCheck_expect_test.expected.ocaml5.32

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,12 @@ Test float_exp 10. < Float.pi failed (3 shrink steps):
459459

460460
--- Failure --------------------------------------------------------------------
461461

462+
Test float_exp -10. > -. Float.pi failed (3 shrink steps):
463+
464+
-4.
465+
466+
--- Failure --------------------------------------------------------------------
467+
462468
Test char never produces 'abcdef' failed (2 shrink steps):
463469

464470
'a'
@@ -2009,7 +2015,7 @@ Collect results for test float classify:
20092015
FP_subnormal: 3 cases (0.1%)
20102016
================================================================================
20112017
1 warning(s)
2012-
failure (105 tests failed, 3 tests errored, ran 216 tests)
2018+
failure (106 tests failed, 3 tests errored, ran 217 tests)
20132019
random seed: 153870556
20142020

20152021
+++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

test/core/QCheck_expect_test.expected.ocaml5.64

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,12 @@ Test float_exp 10. < Float.pi failed (3 shrink steps):
491491

492492
--- Failure --------------------------------------------------------------------
493493

494+
Test float_exp -10. > -. Float.pi failed (3 shrink steps):
495+
496+
-4.
497+
498+
--- Failure --------------------------------------------------------------------
499+
494500
Test char never produces 'abcdef' failed (2 shrink steps):
495501

496502
'a'
@@ -2041,7 +2047,7 @@ Collect results for test float classify:
20412047
FP_subnormal: 3 cases (0.1%)
20422048
================================================================================
20432049
1 warning(s)
2044-
failure (105 tests failed, 3 tests errored, ran 216 tests)
2050+
failure (106 tests failed, 3 tests errored, ran 217 tests)
20452051
random seed: 153870556
20462052

20472053
+++ Stats for int_dist_empty_bucket ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

test/core/QCheck_tests.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,10 @@ module Shrink = struct
650650
Test.make ~name:"float_exp 10. < Float.pi" ~count:1000
651651
(float_exp 10.) (fun f -> f < Float.pi)
652652

653+
let float_exp_m10_gt_mpi =
654+
Test.make ~name:"float_exp -10. > -. Float.pi" ~count:1000
655+
(float_exp (-10.)) (fun f -> f > -. Float.pi)
656+
653657
let char_is_never_abcdef =
654658
Test.make ~name:"char never produces 'abcdef'" ~count:1000
655659
char (fun c -> not (List.mem c ['a';'b';'c';'d';'e';'f']))
@@ -944,6 +948,7 @@ module Shrink = struct
944948
float_neg_not_nan;
945949
float_neg_not_infinite;
946950
float_exp_10_lt_pi;
951+
float_exp_m10_gt_mpi;
947952
char_is_never_abcdef;
948953
char_range_is_never_abc;
949954
char_printable_is_never_sign;

0 commit comments

Comments
 (0)