Fix conditional in check for new -0.0 behaviour

This commit is contained in:
Marcel Otto 2021-05-23 00:29:41 +02:00
parent db6be78908
commit 7645ce5fc6
2 changed files with 3 additions and 3 deletions

View file

@ -142,7 +142,7 @@ defmodule RDF.XSD.TestData do
"+01.000" => {1.0e0, "+01.000", "1.0E0"}, "+01.000" => {1.0e0, "+01.000", "1.0E0"},
"1.0" => {1.0e0, "1.0", "1.0E0"}, "1.0" => {1.0e0, "1.0", "1.0E0"},
"-0" => "-0" =>
if Version.match?(System.version(), "~> 1.12") do if String.to_integer(System.otp_release()) >= 24 do
{0.0e0, "-0", "-0.0E0"} {0.0e0, "-0", "-0.0E0"}
else else
# This is actual wrong, but we won't fix this wrong behaviour in older Elixir versions # This is actual wrong, but we won't fix this wrong behaviour in older Elixir versions

View file

@ -106,7 +106,7 @@ defmodule RDF.XSD.DecimalTest do
assert XSD.double(3.14) |> XSD.Decimal.cast() == XSD.decimal(3.14) assert XSD.double(3.14) |> XSD.Decimal.cast() == XSD.decimal(3.14)
assert XSD.double(10.1e1) |> XSD.Decimal.cast() == XSD.decimal(101.0) 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") assert XSD.double("-0.0") |> XSD.Decimal.cast() == XSD.decimal("-0.0")
else else
# This is actual wrong, but we won't fix this wrong behaviour in older Elixir versions # 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(3.14) |> XSD.Decimal.cast() == XSD.decimal(3.14)
assert XSD.float(10.1e1) |> XSD.Decimal.cast() == XSD.decimal(101.0) 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") assert XSD.float("-0.0") |> XSD.Decimal.cast() == XSD.decimal("-0.0")
else else
# This is actual wrong, but we won't fix this wrong behaviour in older Elixir versions # This is actual wrong, but we won't fix this wrong behaviour in older Elixir versions