Fixes #30: Implement exp notation in floats

This commit is contained in:
Thomas Pelletier
2014-12-06 13:56:27 +01:00
parent b814e1a94f
commit 543444f747
3 changed files with 63 additions and 1 deletions
+11
View File
@@ -70,6 +70,17 @@ func TestSimpleNumbers(t *testing.T) {
})
}
func TestFloatsWithExponents(t *testing.T) {
tree, err := Load("a = 5e+22\nb = 5E+22\nc = -5e+22\nd = -5e-22\ne = 6.626e-34")
assertTree(t, tree, err, map[string]interface{}{
"a": float64(5e+22),
"b": float64(5E+22),
"c": float64(-5e+22),
"d": float64(-5e-22),
"e": float64(6.626e-34),
})
}
func TestSimpleDate(t *testing.T) {
tree, err := Load("a = 1979-05-27T07:32:00Z")
assertTree(t, tree, err, map[string]interface{}{