Skip to content

Commit

Permalink
Merge branch '0.4-numeric-tests' of https://github.com/ExpHP/toml-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Vejnár committed Jul 19, 2015
2 parents 60b47f4 + fb3a383 commit 522d934
Show file tree
Hide file tree
Showing 26 changed files with 54 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/invalid/exponent-leading-zero-neg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leading-zero = 3e-01
1 change: 1 addition & 0 deletions tests/invalid/exponent-leading-zero-pos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leading-zero = 3e+01
1 change: 1 addition & 0 deletions tests/invalid/exponent-leading-zero.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leading-zero = 3e01
1 change: 1 addition & 0 deletions tests/invalid/float-leading-zero-neg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leading-zero = -03.14
1 change: 1 addition & 0 deletions tests/invalid/float-leading-zero-pos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leading-zero = +03.14
1 change: 1 addition & 0 deletions tests/invalid/float-leading-zero.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leading-zero = 03.14
1 change: 1 addition & 0 deletions tests/invalid/float-underscore-after-point.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bad = 1._2
1 change: 1 addition & 0 deletions tests/invalid/float-underscore-after.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bad = 1.2_
1 change: 1 addition & 0 deletions tests/invalid/float-underscore-before-point.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bad = 1_.2
1 change: 1 addition & 0 deletions tests/invalid/float-underscore-before.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bad = _1.2
1 change: 1 addition & 0 deletions tests/invalid/integer-leading-zero-neg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leading-zero = -012
1 change: 1 addition & 0 deletions tests/invalid/integer-leading-zero-pos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leading-zero = +012
1 change: 1 addition & 0 deletions tests/invalid/integer-leading-zero.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leading-zero = 012
1 change: 1 addition & 0 deletions tests/invalid/integer-underscore-after.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bad = 123_
1 change: 1 addition & 0 deletions tests/invalid/integer-underscore-before.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bad = _123
1 change: 1 addition & 0 deletions tests/invalid/integer-underscore-double.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bad = 1__23
9 changes: 9 additions & 0 deletions tests/valid/float-exponent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"lower": {"type": "float", "value": "300.0"},
"upper": {"type": "float", "value": "300.0"},
"neg": {"type": "float", "value": "0.03"},
"pos": {"type": "float", "value": "300.0"},
"zero": {"type": "float", "value": "3.0"},
"pointlower": {"type": "float", "value": "310.0"},
"pointupper": {"type": "float", "value": "310.0"}
}
7 changes: 7 additions & 0 deletions tests/valid/float-exponent.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lower = 3e2
upper = 3E2
neg = 3e-2
pos = 3E+2
zero = 3e0
pointlower = 3.1e2
pointupper = 3.1E2
5 changes: 5 additions & 0 deletions tests/valid/float-underscore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"before": {"type": "float", "value": "3141.5927"},
"after": {"type": "float", "value": "3141.5927"},
"exponent": {"type": "float", "value": "3e14"}
}
3 changes: 3 additions & 0 deletions tests/valid/float-underscore.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
before = 3_141.5927
after = 3141.592_7
exponent = 3e1_4
4 changes: 3 additions & 1 deletion tests/valid/float.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"pi": {"type": "float", "value": "3.14"},
"negpi": {"type": "float", "value": "-3.14"}
"pospi": {"type": "float", "value": "3.14"},
"negpi": {"type": "float", "value": "-3.14"},
"zero-intpart": {"type": "float", "value": "0.123"}
}
2 changes: 2 additions & 0 deletions tests/valid/float.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
pi = 3.14
pospi = +3.14
negpi = -3.14
zero-intpart = 0.123
3 changes: 3 additions & 0 deletions tests/valid/integer-underscore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"kilo": {"type": "integer", "value": "1000"}
}
1 change: 1 addition & 0 deletions tests/valid/integer-underscore.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kilo = 1_000
4 changes: 3 additions & 1 deletion tests/valid/integer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"answer": {"type": "integer", "value": "42"},
"neganswer": {"type": "integer", "value": "-42"}
"posanswer": {"type": "integer", "value": "42"},
"neganswer": {"type": "integer", "value": "-42"},
"zero": {"type": "integer", "value": "0"}
}
2 changes: 2 additions & 0 deletions tests/valid/integer.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
answer = 42
posanswer = +42
neganswer = -42
zero = 0

0 comments on commit 522d934

Please sign in to comment.