File tree Expand file tree Collapse file tree 2 files changed +8
-23
lines changed
Expand file tree Collapse file tree 2 files changed +8
-23
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import (
1414 log "github.com/sirupsen/logrus"
1515 "io/ioutil"
1616 "k8s.io/client-go/util/jsonpath"
17- "math/big"
1817 "math/rand"
1918 "net/http"
2019 "net/url"
@@ -400,12 +399,14 @@ func jsonPath(query, toMatch string) interface{} {
400399 return ""
401400 }
402401
403- // Jsonpath library converts large int into a string with scientific notion, the following
404- // reverts that process to avoid mismatching when using the jsonpath result for csv data lookup
405- bigInt := new (big.Int )
406- if _ , ok := bigInt .SetString (result , 10 ); ok {
407- result = fmt .Sprint (bigInt )
408- }
402+ //// Jsonpath library converts large int into a string with scientific notion, the following
403+ //// reverts that process to avoid mismatching when using the jsonpath result for csv data lookup
404+ //floatResult, err := strconv.ParseFloat(result, 64)
405+ //// if the string is a float and a whole number
406+ //if err == nil && floatResult == float64(int64(floatResult)) {
407+ // intResult := int(floatResult)
408+ // result = strconv.Itoa(intResult)
409+ //}
409410
410411 // convert to array data if applicable
411412 var data interface {}
Original file line number Diff line number Diff line change @@ -234,22 +234,6 @@ func Test_CopyMap(t *testing.T) {
234234 Expect (newMap ["second" ]).To (Equal ("2" ))
235235}
236236
237- func Test_JsonPathMethod_WithBigFloatingNumber (t * testing.T ) {
238-
239- RegisterTestingT (t )
240- res := jsonPath (PrepareJsonPathQuery ("$.registrant" ),
241- `{"registrant":"13495985898986869898697879879987978978.12345566777"}` )
242- Expect (res ).To (Equal ("13495985898986869898697879879987978978.12345566777" ))
243- }
244-
245- func Test_JsonPathMethod_WithBigIntegerNumber (t * testing.T ) {
246-
247- RegisterTestingT (t )
248- res := jsonPath (PrepareJsonPathQuery ("$.registrant" ),
249- `{"registrant":"13495985898986869898697879879987978978"}` )
250- Expect (res ).To (Equal ("13495985898986869898697879879987978978" ))
251- }
252-
253237func Test_Identical_ReturnsTrue_WithExactlySameArray (t * testing.T ) {
254238 RegisterTestingT (t )
255239 first := [2 ]string {"q1" , "q2" }
You can’t perform that action at this time.
0 commit comments