From 7645ce5fc64649b93911585304dc4c7ff3f0e968 Mon Sep 17 00:00:00 2001 From: Marcel Otto Date: Sun, 23 May 2021 00:29:41 +0200 Subject: [PATCH] Fix conditional in check for new -0.0 behaviour --- test/support/xsd_test_data.ex | 2 +- test/unit/xsd/datatypes/decimal_test.exs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/support/xsd_test_data.ex b/test/support/xsd_test_data.ex index f710715..1128d48 100644 --- a/test/support/xsd_test_data.ex +++ b/test/support/xsd_test_data.ex @@ -142,7 +142,7 @@ defmodule RDF.XSD.TestData do "+01.000" => {1.0e0, "+01.000", "1.0E0"}, "1.0" => {1.0e0, "1.0", "1.0E0"}, "-0" => - if Version.match?(System.version(), "~> 1.12") do + if String.to_integer(System.otp_release()) >= 24 do {0.0e0, "-0", "-0.0E0"} else # This is actual wrong, but we won't fix this wrong behaviour in older Elixir versions diff --git a/test/unit/xsd/datatypes/decimal_test.exs b/test/unit/xsd/datatypes/decimal_test.exs index 7ae9389..4dd80bc 100644 --- a/test/unit/xsd/datatypes/decimal_test.exs +++ b/test/unit/xsd/datatypes/decimal_test.exs @@ -106,7 +106,7 @@ defmodule RDF.XSD.DecimalTest do assert XSD.double(3.14) |> XSD.Decimal.cast() == XSD.decimal(3.14) assert XSD.double(10.1e1) |> XSD.Decimal.cast() == XSD.decimal(101.0) - if Version.match?(System.version(), "~> 1.12") do + if String.to_integer(System.otp_release()) >= 24 do assert XSD.double("-0.0") |> XSD.Decimal.cast() == XSD.decimal("-0.0") else # This is actual wrong, but we won't fix this wrong behaviour in older Elixir versions @@ -124,7 +124,7 @@ defmodule RDF.XSD.DecimalTest do assert XSD.float(3.14) |> XSD.Decimal.cast() == XSD.decimal(3.14) assert XSD.float(10.1e1) |> XSD.Decimal.cast() == XSD.decimal(101.0) - if Version.match?(System.version(), "~> 1.12") do + if String.to_integer(System.otp_release()) >= 24 do assert XSD.float("-0.0") |> XSD.Decimal.cast() == XSD.decimal("-0.0") else # This is actual wrong, but we won't fix this wrong behaviour in older Elixir versions