Skip to content

Commit

Permalink
Merge pull request #57 from dw-kihara/fix/float_zero_match
Browse files Browse the repository at this point in the history
Fixed tests to handle zero matching in OTP 27
  • Loading branch information
dumbbell authored Jun 5, 2024
2 parents deefe3b + cfaafe5 commit 62e91aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions test/construction/float.erl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ schema_failsafe_float_json_simple_test_() ->
?_assertMatch(
[
[
0.0, "+0", 0.0,
+0.0, "+0", +0.0,
123.0, "+123", -123.0,
12.34, "+12.34", -12.34,
1.2e+11, "+12e10", -1.2e+11,
Expand Down Expand Up @@ -69,7 +69,7 @@ schema_failsafe_float_simple_test_() ->
?_assertMatch(
[
[
0.0, 0.0, 0.0,
+0.0, +0.0, -0.0,
123.0, 123.0, -123.0,
12.34, 12.34, -12.34,
1.2e+11, 1.2e+11, -1.2e+11,
Expand Down Expand Up @@ -97,13 +97,13 @@ schema_failsafe_float_ext_simple_test_() ->
?_assertMatch(
[
[
0.0, 0.0, 0.0,
+0.0, +0.0, -0.0,
"123", "+123", "-123",
12.34, 12.34, -12.34,
"12e10", "+12e10", "-12e10",
"1.2e11", 1.2e+11, 1.2e-11,
"1.0e10", "1.0E10",
".", 0.1, 0.0, 1.0, 1000.0,
".", 0.1, +0.0, 1.0, 1000.0,
685230.15, 685230.15, -685230.15,
'+inf', '+inf', '-inf', 'nan',
'+inf', '+inf', ".iNF",
Expand Down Expand Up @@ -263,14 +263,14 @@ schema_failsafe_float_json_detailed_test_() ->
{yamerl_float,yamerl_node_float_json,
"tag:yaml.org,2002:float",
[{line,1},{column,4}],
0.0},
+0.0},
{yamerl_str,yamerl_node_str,"tag:yaml.org,2002:str",
[{line,2},{column,3}],
"+0"},
{yamerl_float,yamerl_node_float_json,
"tag:yaml.org,2002:float",
[{line,3},{column,3}],
0.0},
+0.0},
{yamerl_float,yamerl_node_float_json,
"tag:yaml.org,2002:float",
[{line,5},{column,4}],
Expand Down Expand Up @@ -414,13 +414,13 @@ schema_failsafe_float_detailed_test_() ->
[
{yamerl_float,yamerl_node_float,"tag:yaml.org,2002:float",
[{line,1},{column,4}],
0.0},
+0.0},
{yamerl_float,yamerl_node_float,"tag:yaml.org,2002:float",
[{line,2},{column,3}],
0.0},
+0.0},
{yamerl_float,yamerl_node_float,"tag:yaml.org,2002:float",
[{line,3},{column,3}],
0.0},
-0.0},
{yamerl_float,yamerl_node_float,"tag:yaml.org,2002:float",
[{line,5},{column,4}],
123.0},
Expand Down Expand Up @@ -549,15 +549,15 @@ schema_failsafe_float_ext_detailed_test_() ->
{yamerl_float,yamerl_node_float_ext,
"tag:yaml.org,2002:float",
[{line,1},{column,4}],
0.0},
+0.0},
{yamerl_float,yamerl_node_float_ext,
"tag:yaml.org,2002:float",
[{line,2},{column,3}],
0.0},
+0.0},
{yamerl_float,yamerl_node_float_ext,
"tag:yaml.org,2002:float",
[{line,3},{column,3}],
0.0},
-0.0},
{yamerl_str,yamerl_node_str,"tag:yaml.org,2002:str",
[{line,5},{column,4}],
"123"},
Expand Down Expand Up @@ -615,7 +615,7 @@ schema_failsafe_float_ext_detailed_test_() ->
{yamerl_float,yamerl_node_float_ext,
"tag:yaml.org,2002:float",
[{line,26},{column,4}],
0.0},
+0.0},
{yamerl_float,yamerl_node_float_ext,
"tag:yaml.org,2002:float",
[{line,27},{column,3}],
Expand Down
4 changes: 2 additions & 2 deletions test/construction/float_yaml11.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ schema_failsafe_float_ext_simple_test_() ->
"12e10", "+12e10", "-12e10",
"1.2e11", 1.2e+11, 1.2e-11,
"1.0e10", "1.0E10",
".", 0.1, 0.0, 1.0, 1000.0,
".", 0.1, +0.0, 1.0, 1000.0,
685230.15, 685230.15, -685230.15,
'+inf', '+inf', '-inf', 'nan',
'+inf', '+inf', ".iNF",
Expand Down Expand Up @@ -88,7 +88,7 @@ schema_failsafe_float_ext_detailed_test_() ->
{yamerl_float,yamerl_node_float_ext,
"tag:yaml.org,2002:float",
[{line,20},{column,4}],
0.0},
+0.0},
{yamerl_float,yamerl_node_float_ext,
"tag:yaml.org,2002:float",
[{line,21},{column,3}],
Expand Down

0 comments on commit 62e91aa

Please sign in to comment.