Add float to test case to check leading zeroes in exponent parts (#363)

* add float to test case to check leading zeroes in exponent parts

* add testcase for query pkg
This commit is contained in:
Riya John
2020-04-22 08:15:49 +05:30
committed by GitHub
parent e872682c78
commit 24d4446802
5 changed files with 10 additions and 1 deletions
+1
View File
@@ -27,3 +27,4 @@ enabled = true
[clients] [clients]
data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it
score = 4e-08 # to make sure leading zeroes in exponent parts of floats are supported
+1
View File
@@ -27,3 +27,4 @@ enabled = true
[clients] [clients]
data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it
score = 4e-08 # to make sure leading zeroes in exponent parts of floats are supported
+2
View File
@@ -783,6 +783,7 @@ func TestParseFile(t *testing.T) {
[]string{"gamma", "delta"}, []string{"gamma", "delta"},
[]int64{1, 2}, []int64{1, 2},
}, },
"score": 4e-08,
}, },
}) })
} }
@@ -819,6 +820,7 @@ func TestParseFileCRLF(t *testing.T) {
[]string{"gamma", "delta"}, []string{"gamma", "delta"},
[]int64{1, 2}, []int64{1, 2},
}, },
"score": 4e-08,
}, },
}) })
} }
+5 -1
View File
@@ -407,7 +407,10 @@ func TestQueryFilterFn(t *testing.T) {
assertQueryPositions(t, string(buff), assertQueryPositions(t, string(buff),
"$..[?(float)]", "$..[?(float)]",
[]interface{}{ // no float values in document []interface{}{
queryTestNode{
4e-08, toml.Position{30, 1},
},
}) })
tv, _ := time.Parse(time.RFC3339, "1979-05-27T07:32:00Z") tv, _ := time.Parse(time.RFC3339, "1979-05-27T07:32:00Z")
@@ -460,6 +463,7 @@ func TestQueryFilterFn(t *testing.T) {
[]interface{}{"gamma", "delta"}, []interface{}{"gamma", "delta"},
[]interface{}{int64(1), int64(2)}, []interface{}{int64(1), int64(2)},
}, },
"score": 4e-08,
}, toml.Position{28, 1}, }, toml.Position{28, 1},
}, },
}) })
+1
View File
@@ -236,6 +236,7 @@ func TestTreeWriteToMapExampleFile(t *testing.T) {
[]interface{}{"gamma", "delta"}, []interface{}{"gamma", "delta"},
[]interface{}{int64(1), int64(2)}, []interface{}{int64(1), int64(2)},
}, },
"score": 4e-08,
}, },
} }
testMaps(t, tree.ToMap(), expected) testMaps(t, tree.ToMap(), expected)