Skip to content

Commit 87683ef

Browse files
committed
New test cases for exponent marker E and leading +
1 parent eb9c776 commit 87683ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/elixir/test/elixir/float_test.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ defmodule FloatTest do
2424
assert Float.parse("1.32453e-10") === {1.32453e-10, ""}
2525
assert Float.parse("1.32.45") === {1.32, ".45"}
2626
assert Float.parse("1.o") === {1.0, ".o"}
27+
assert Float.parse("+12.3E+4") === {1.23e5, ""}
28+
assert Float.parse("+12.3E-4x") === {0.00123, "x"}
29+
assert Float.parse("-1.23e-0xFF") === {-1.23, "xFF"}
30+
assert Float.parse("-1.e2") === {-1.0, ".e2"}
31+
assert Float.parse(".12") === :error
2732
assert Float.parse("--1.2") === :error
2833
assert Float.parse("++1.2") === :error
2934
assert Float.parse("pi") === :error

0 commit comments

Comments
 (0)