File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ func TestGetStringAtKey(t *testing.T) {
5555 "rootFoo": "bar",
5656 "top": {
5757 "foo": "bar",
58- "number": 1,
58+ "number": 1234567890,
59+ "float": 1.23456789,
5960 "middle": {
6061 "bottom": {
6162 "foo": "bar"
@@ -103,8 +104,15 @@ func TestGetStringAtKey(t *testing.T) {
103104 res , err = GetStringAtKey (test_obj , "top/number" , debug )
104105 if err != nil {
105106 t .Fatalf ("Error extracting 'top/number' from JSON payload: %s" , err )
106- } else if "1" != res {
107- t .Fatalf ("Error: Expected '1', but got %s" , res )
107+ } else if "1234567890" != res {
108+ t .Fatalf ("Error: Expected '1234567890', but got %s" , res )
109+ }
110+
111+ res , err = GetStringAtKey (test_obj , "top/float" , debug )
112+ if err != nil {
113+ t .Fatalf ("Error extracting 'top/float' from JSON payload: %s" , err )
114+ } else if "1.23456789" != res {
115+ t .Fatalf ("Error: Expected '1.23456789', but got %s" , res )
108116 }
109117}
110118
You can’t perform that action at this time.
0 commit comments