This is an automated email from the ASF dual-hosted git repository. nickva pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/couchdb-jiffy.git
commit 936e0f8c1a871915ea8c10673b35075a7fdf4317 Author: Nick Vatamaniuc <[email protected]> AuthorDate: Sat Mar 28 15:32:07 2026 -0400 Fix OTP 27 prop tests In OTP 27 0.0 =/= -0.0 and because of that exact term matching in the prop check started to fail. To avoid that, do not generate -0.0 in the prop tests instead test it explicilty elsewhere. It may seem tempting to switch to == for prop check instead, however that would mean we'd also loose type checks that ints stayed ints and floats stayed floats in general. --- .github/workflows/ci.yml | 20 ++++---------------- Makefile | 1 + test/jiffy_03_number_tests.erl | 2 ++ test/jiffy_11_property_tests.erl | 10 +++++++++- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df72868..aa40a20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: # they are on OTP 25 so we can use erlang up to version 27 technically. # eqc-mini-25: - name: eqc-mini + name: eqc-mini-25 runs-on: ubuntu-latest container: image: erlang:25 @@ -44,29 +44,17 @@ jobs: run: | make REBAR=rebar3 check-with-eqc - eqc-mini-26: - name: eqc-mini + eqc-mini-27: + name: eqc-mini-27 runs-on: ubuntu-latest container: - image: erlang:26 + image: erlang:27 steps: - uses: actions/checkout@v6 - name: rebar3 make check-with-eqc run: | make REBAR=rebar3 check-with-eqc - # This currently fails. Most likely related to 0.0 - # eqc-mini-27: - # name: eqc-mini - # runs-on: ubuntu-latest - # container: - # image: erlang:27 - # steps: - # - uses: actions/checkout@v6 - # - name: rebar3 make check-with-eqc - # run: | - # make REBAR=rebar3 check-with-eqc - gcc-14: name: gcc-14 runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 5b8ef81..5f48efb 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ clean: rm -rf .eunit rm -f test/*.beam rm -rf eqc + rm -rf _build distclean: clean diff --git a/test/jiffy_03_number_tests.erl b/test/jiffy_03_number_tests.erl index 7ae8404..82f4eef 100644 --- a/test/jiffy_03_number_tests.erl +++ b/test/jiffy_03_number_tests.erl @@ -45,6 +45,7 @@ cases(ok) -> [ {<<"0">>, 0}, {<<"-0">>, 0, <<"0">>}, + {<<"-0.0">>, -0.0, <<"0.0">>}, {<<"1">>, 1}, {<<"12">>, 12}, {<<"-3">>, -3}, @@ -106,6 +107,7 @@ cases(error) -> cases(floats) -> [ 0.0, + -0.0, 0.00000001, 0.000000012, 0.0000000123, diff --git a/test/jiffy_11_property_tests.erl b/test/jiffy_11_property_tests.erl index b3f05a7..15840f5 100644 --- a/test/jiffy_11_property_tests.erl +++ b/test/jiffy_11_property_tests.erl @@ -130,6 +130,14 @@ any(S) -> any_value() -> oneof(any_value_types()). +% As of OTP 27 0.0 =/= -0.0 so we cannot use exact matching on round trips any +% longer. Therefore we test the 0.0 and -0.0 round-trip explicilty somewhere +% else but here we exclude it. We don't want to use == for term matching +% either, because then we'd be losing a check that ints stay as ints and floats +% as floats. +% +real_non_neg_0() -> + ?SUCHTHAT(F, real(), F =/= -0.0). any_value_types() -> [ @@ -196,7 +204,7 @@ json_false() -> json_number() -> - oneof([largeint(), int(), real()]). + oneof([largeint(), int(), real_non_neg_0()]). json_string() ->
