github.com/dgraph-io/simdjson-go@v0.3.0/simdjson_amd64_test.go (about) 1 //+build !noasm 2 //+build !appengine 3 //+build gc 4 5 /* 6 * MinIO Cloud Storage, (C) 2020 MinIO, Inc. 7 * 8 * Licensed under the Apache License, Version 2.0 (the "License"); 9 * you may not use this file except in compliance with the License. 10 * You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 21 package simdjson 22 23 import ( 24 "encoding/json" 25 "reflect" 26 "strings" 27 "testing" 28 ) 29 30 func TestParseND(t *testing.T) { 31 if !SupportedCPU() { 32 t.SkipNow() 33 } 34 tests := []struct { 35 name string 36 skipFloats bool // Skip tests that contain float64 inprecisions (see GOLANG_NUMBER_PARSING flag) 37 js string 38 want string 39 wantErr bool 40 }{ 41 { 42 name: "demo", 43 js: `{"three":true,"two":"foo","one":-1} 44 {"three":false,"two":"bar","one":null} 45 {"three":true,"two":"baz","one":2.5}`, 46 want: `{"three":true,"two":"foo","one":-1} 47 {"three":false,"two":"bar","one":null} 48 {"three":true,"two":"baz","one":2.5}`, 49 wantErr: false, 50 }, 51 { 52 name: "valid", 53 js: `{"bimbam":12345465.447,"bumbum":true,"istrue":true,"isfalse":false,"aap":null}`, 54 want: `{"bimbam":12345465.447,"bumbum":true,"istrue":true,"isfalse":false,"aap":null}`, 55 wantErr: false, 56 }, 57 { 58 name: "floatinvalid", 59 skipFloats: true, 60 js: `{"bimbam":12345465.44j7,"bumbum":true}`, 61 wantErr: true, 62 }, 63 { 64 name: "numberinvalid", 65 skipFloats: true, 66 js: `{"bimbam":1234546544j7}`, 67 wantErr: true, 68 }, 69 { 70 name: "emptyobject", 71 js: `{}`, 72 want: `{}`, 73 wantErr: false, 74 }, 75 { 76 name: "emptyslice", 77 js: ``, 78 wantErr: true, 79 }, 80 { 81 name: "types", 82 js: `{"controversiality":0,"body":"A look at Vietnam and Mexico exposes the myth of market liberalisation.","subreddit_id":"t5_6","link_id":"t3_17863","stickied":false,"subreddit":"reddit.com","score":2,"ups":2,"author_flair_css_class":null,"created_utc":1134365188,"author_flair_text":null,"author":"frjo","id":"c13","edited":false,"parent_id":"t3_17863","gilded":0,"distinguished":null,"retrieved_on":1473738411} 83 {"created_utc":1134365725,"author_flair_css_class":null,"score":1,"ups":1,"subreddit":"reddit.com","stickied":false,"link_id":"t3_17866","subreddit_id":"t5_6","controversiality":0,"body":"The site states \"What can I use it for? Meeting notes, Reports, technical specs Sign-up sheets, proposals and much more...\", just like any other new breeed of sites that want us to store everything we have on the web. And they even guarantee multiple levels of security and encryption etc. But what prevents these web site operators fom accessing and/or stealing Meeting notes, Reports, technical specs Sign-up sheets, proposals and much more, for competitive or personal gains...? I am pretty sure that most of them are honest, but what's there to prevent me from setting up a good useful site and stealing all your data? Call me paranoid - I am.","retrieved_on":1473738411,"distinguished":null,"gilded":0,"id":"c14","edited":false,"parent_id":"t3_17866","author":"zse7zse","author_flair_text":null}`, 84 want: `{"controversiality":0,"body":"A look at Vietnam and Mexico exposes the myth of market liberalisation.","subreddit_id":"t5_6","link_id":"t3_17863","stickied":false,"subreddit":"reddit.com","score":2,"ups":2,"author_flair_css_class":null,"created_utc":1134365188,"author_flair_text":null,"author":"frjo","id":"c13","edited":false,"parent_id":"t3_17863","gilded":0,"distinguished":null,"retrieved_on":1473738411} 85 {"created_utc":1134365725,"author_flair_css_class":null,"score":1,"ups":1,"subreddit":"reddit.com","stickied":false,"link_id":"t3_17866","subreddit_id":"t5_6","controversiality":0,"body":"The site states \"What can I use it for? Meeting notes, Reports, technical specs Sign-up sheets, proposals and much more...\", just like any other new breeed of sites that want us to store everything we have on the web. And they even guarantee multiple levels of security and encryption etc. But what prevents these web site operators fom accessing and/or stealing Meeting notes, Reports, technical specs Sign-up sheets, proposals and much more, for competitive or personal gains...? I am pretty sure that most of them are honest, but what's there to prevent me from setting up a good useful site and stealing all your data? Call me paranoid - I am.","retrieved_on":1473738411,"distinguished":null,"gilded":0,"id":"c14","edited":false,"parent_id":"t3_17866","author":"zse7zse","author_flair_text":null}`, 86 }, 87 } 88 for _, tt := range tests { 89 t.Run(tt.name, func(t *testing.T) { 90 got, err := ParseND([]byte(tt.js), nil) 91 if (err != nil) != tt.wantErr { 92 t.Errorf("ParseND() error = %v, wantErr %v", err, tt.wantErr) 93 return 94 } 95 if tt.wantErr { 96 return 97 } 98 // Compare all 99 i := got.Iter() 100 b2, err := i.MarshalJSON() 101 if string(b2) != tt.want { 102 t.Errorf("ParseND() got = %v, want %v", string(b2), tt.want) 103 } 104 105 // Compare each element 106 i = got.Iter() 107 ref := strings.Split(tt.js, "\n") 108 for i.Advance() == TypeRoot { 109 _, obj, err := i.Root(nil) 110 if err != nil { 111 t.Fatal(err) 112 } 113 want := ref[0] 114 ref = ref[1:] 115 got, err := obj.MarshalJSON() 116 if err != nil { 117 t.Fatal(err) 118 } 119 if string(got) != want { 120 t.Errorf("ParseND() got = %v, want %v", string(got), want) 121 } 122 } 123 124 i = got.Iter() 125 ref = strings.Split(tt.js, "\n") 126 for i.Advance() == TypeRoot { 127 typ, obj, err := i.Root(nil) 128 if err != nil { 129 t.Fatal(err) 130 } 131 switch typ { 132 case TypeObject: 133 // We must send it throught marshall/unmarshall to match. 134 var want = ref[0] 135 var tmpMap map[string]interface{} 136 err := json.Unmarshal([]byte(want), &tmpMap) 137 if err != nil { 138 t.Fatal(err) 139 } 140 w2, err := json.Marshal(tmpMap) 141 if err != nil { 142 t.Fatal(err) 143 } 144 want = string(w2) 145 got, err := obj.Interface() 146 if err != nil { 147 t.Fatal(err) 148 } 149 gotAsJson, err := json.Marshal(got) 150 if err != nil { 151 t.Fatal(err) 152 } 153 if !reflect.DeepEqual(string(gotAsJson), want) { 154 t.Errorf("ParseND() got = %#v, want %#v", string(gotAsJson), want) 155 } 156 } 157 ref = ref[1:] 158 } 159 }) 160 } 161 } 162 163 func TestParseFailCases(t *testing.T) { 164 if !SupportedCPU() { 165 t.SkipNow() 166 } 167 168 tests := []struct { 169 name string 170 js string 171 want string 172 wantErr bool 173 }{ 174 { 175 name: "fail01_EXCLUDE", 176 js: `"A JSON payload should be an object or array, not a string."`, 177 wantErr: true, 178 }, 179 { 180 name: "fail02", 181 js: `["Unclosed array"`, 182 wantErr: true, 183 }, 184 { 185 name: "fail03", 186 js: `{unquoted_key: "keys must be quoted"}`, 187 wantErr: true, 188 }, 189 { 190 name: "fail04", 191 js: `["extra comma",]`, 192 wantErr: true, 193 }, 194 { 195 name: "fail05", 196 js: `["double extra comma",,]`, 197 wantErr: true, 198 }, 199 { 200 name: "fail06", 201 js: `[ , "<-- missing value"]`, 202 wantErr: true, 203 }, 204 { 205 name: "fail07", 206 js: `["Comma after the close"],`, 207 wantErr: true, 208 }, 209 { 210 name: "fail08", 211 js: `["Extra close"]]`, 212 wantErr: true, 213 }, 214 { 215 name: "fail09", 216 js: `{"Extra comma": true,}`, 217 wantErr: true, 218 }, 219 { 220 name: "fail10", 221 js: `{"Extra value after close": true} "misplaced quoted value"`, 222 wantErr: true, 223 }, 224 { 225 name: "fail11", 226 js: `{"Illegal expression": 1 + 2}`, 227 wantErr: true, 228 }, 229 { 230 name: "fail12", 231 js: `{"Illegal invocation": alert()}`, 232 wantErr: true, 233 }, 234 { 235 name: "fail13", 236 js: `{"Numbers cannot have leading zeroes": 013}`, 237 wantErr: true, 238 }, 239 { 240 name: "fail14", 241 js: `{"Numbers cannot be hex": 0x14}`, 242 wantErr: true, 243 }, 244 { 245 name: "fail15", 246 js: `["Illegal backslash escape: ` + string(byte(0x15)) + `"]`, 247 wantErr: true, 248 }, 249 { 250 name: "fail16", 251 js: `[\naked]`, 252 wantErr: true, 253 }, 254 { 255 name: "fail17", 256 js: `["Illegal backslash escape: ` + string(byte(0x17)) + `"]`, 257 wantErr: true, 258 }, 259 { 260 name: "fail19", 261 js: `{"Missing colon" null}`, 262 wantErr: true, 263 }, 264 { 265 name: "fail20", 266 js: `{"Double colon":: null}`, 267 wantErr: true, 268 }, 269 { 270 name: "fail21", 271 js: `{"Comma instead of colon", null}`, 272 wantErr: true, 273 }, 274 { 275 name: "fail22", 276 js: `["Colon instead of comma": false]`, 277 wantErr: true, 278 }, 279 { 280 name: "fail23", 281 js: `["Bad value", truth]`, 282 wantErr: true, 283 }, 284 { 285 name: "fail24", 286 js: `['single quote']`, 287 wantErr: true, 288 }, 289 { 290 name: "fail25", 291 js: `[" tab character in string "]`, 292 wantErr: true, 293 }, 294 // fail26 is disabled for simdjson-go (not leading to errors, C specific escaping) 295 //{ 296 // name: "fail26", 297 // js: `["tab\ character\ in\ string\ "]`, 298 // wantErr: true, 299 //}, 300 { 301 name: "fail27", 302 js: `["line 303 break"]`, 304 wantErr: true, 305 }, 306 { 307 name: "fail28", 308 js: `["line\ 309 break"]`, 310 wantErr: true, 311 }, 312 { 313 name: "fail29", 314 js: `[0e]`, 315 wantErr: true, 316 }, 317 { 318 name: "fail30", 319 js: `[0e+]`, 320 wantErr: true, 321 }, 322 { 323 name: "fail31", 324 js: `[0e+-1]`, 325 wantErr: true, 326 }, 327 { 328 name: "fail32", 329 js: `{"Comma instead if closing brace": true,`, 330 wantErr: true, 331 }, 332 { 333 name: "fail33", 334 js: `["mismatch"}`, 335 wantErr: true, 336 }, 337 { 338 name: "fail35", 339 js: `{"this file" :` + string(byte(0xa0)) + `"has an unbreakable character outside the strings"}`, 340 wantErr: true, 341 }, 342 { 343 name: "fail36", 344 js: `["this is an unclosed string ]`, 345 wantErr: true, 346 }, 347 { 348 name: "fail37", 349 js: `[12a]`, 350 wantErr: true, 351 }, 352 { 353 name: "fail38", 354 js: `[12 a]`, 355 wantErr: true, 356 }, 357 { 358 name: "fail39_EXCLUDE", 359 js: `{"name":1,"name":2, "this is allowable as per the json spec": true}`, 360 want: `{"name":1,"name":2,"this is allowable as per the json spec":true}`, 361 wantErr: false, 362 }, 363 { 364 name: "fail41_toolarge", 365 js: `18446744073709551616`, 366 wantErr: true, 367 }, 368 { 369 name: "fail42", 370 js: `{"fdfds": 371 "4332" }`, 372 wantErr: true, 373 }, 374 { 375 name: "fail43", 376 js: `[-]`, 377 wantErr: true, 378 }, 379 { 380 name: "fail44", 381 js: `[-2.]`, 382 wantErr: true, 383 }, 384 { 385 name: "fail45", 386 js: `[0.e1]`, 387 wantErr: true, 388 }, 389 { 390 name: "fail46", 391 js: `[2.e+3]`, 392 wantErr: true, 393 }, 394 { 395 name: "fail47", 396 js: `[2.e-3]`, 397 wantErr: true, 398 }, 399 { 400 name: "fail48", 401 js: `[2.e3]`, 402 wantErr: true, 403 }, 404 { 405 name: "fail49", 406 js: `[-.123]`, 407 wantErr: true, 408 }, 409 { 410 name: "fail50", 411 js: `[1.]`, 412 wantErr: true, 413 }, 414 { 415 name: "fail51", 416 js: `[],`, 417 wantErr: true, 418 }, 419 { 420 name: "fail52", 421 js: `[x]]`, 422 wantErr: true, 423 }, 424 { 425 name: "fail53", 426 js: `{}}`, 427 wantErr: true, 428 }, 429 { 430 name: "fail54", 431 js: `[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[(...)`, 432 wantErr: true, 433 }, 434 { 435 name: "fail55", 436 js: `[1,]`, 437 wantErr: true, 438 }, 439 { 440 name: "fail56", 441 js: `["",]`, 442 wantErr: true, 443 }, 444 // fail57 through to fail59 and fail61 are disabled for simdjson-go as Go does not allow illegal unicode chars 445 // { name: "fail57", js: `{ "name": "\udc00\ud800\uggggxy" }`, wantErr: true }, 446 // { name: "fail58", js: `{ "name": "\uc0meatmebro" }`, wantErr: true }, 447 // { name: "fail59", js: `{ "name": "\uf**k" }`, wantErr: true }, 448 // { name: "fail61", js: `{"badescape":"\uxhgj"}`, wantErr: true }, 449 { 450 name: "fail60", 451 js: `[1e+1111]`, 452 wantErr: true, 453 }, 454 { 455 name: "fail62", 456 js: `{"foo":"baa}`, 457 wantErr: true, 458 }, 459 { 460 name: "fail63", 461 js: `"f[`, 462 wantErr: true, 463 }, 464 { 465 name: "fail64", 466 js: `"`, 467 wantErr: true, 468 }, 469 { 470 name: "fail65", 471 js: `falsy`, 472 wantErr: true, 473 }, 474 { 475 name: "fail66", 476 js: `44`, 477 wantErr: true, 478 }, 479 { 480 name: "fail67", 481 js: `4 4`, 482 wantErr: true, 483 }, 484 { 485 name: "fail68", 486 js: `04`, 487 wantErr: true, 488 }, 489 { 490 name: "fail69", 491 js: `falsefalse`, 492 wantErr: true, 493 }, 494 { 495 name: "fail70", 496 js: ``, 497 wantErr: true, 498 }, 499 { 500 name: "fail71", 501 js: `"a bad string��"`, 502 wantErr: true, 503 }, 504 { 505 name: "fail73", 506 js: `10000000000000000000000000000000000000000000e+308`, 507 wantErr: true, 508 }, 509 { 510 name: "fail74", 511 js: `[7,7,7,7,6,7,7,7,6,7,7,6,[7,7,7,7,6,7,7,7,6,7,7,6,7,7,7,7,7,7,6`, 512 wantErr: true, 513 }, 514 { 515 name: "fail75", 516 js: `f`, 517 wantErr: true, 518 }, 519 { 520 name: "noclose", 521 js: `{"bimbam:"something"`, 522 wantErr: true, 523 }, 524 { 525 name: "noclose-issue-13", 526 js: `{"000"`, 527 wantErr: true, 528 }, 529 { 530 name: "noclose-issue-23", 531 js: `{""0`, 532 wantErr: true, 533 }, 534 { 535 name: "issue-17", 536 js: `{"bimbam:12345465.44j7,"bumbum":true}`, 537 wantErr: true, 538 }, 539 { 540 name: "nonewlineinkeys-issue-27", 541 js: `{" 542 ":"","00":""}`, 543 wantErr: true, 544 }, 545 { 546 name: "noclose-issue-19", 547 js: `[0.0`, 548 wantErr: true, 549 }, 550 { 551 name: "binaryinput-issue-20", 552 js: string([]byte{0x09, 0x20, 0x20, 0x0a}), 553 wantErr: true, 554 }, 555 //{ 556 // name: "invalidjson-issue-24", 557 // js: "{\"\":[],\"\":[5\x00]}", 558 // want: "{\"\":[],\"\":[5\x00]}", 559 // wantErr: false, 560 //}, 561 //{ 562 // name: "invalidchar-issue-25", 563 // js: `{"":"\_000"}`, 564 // wantErr: true, 565 //}, 566 { 567 name: "fatal-error-issue-32", 568 js: `{"":`, 569 wantErr: true, 570 }, 571 { 572 name: "index-out-of-range-issue-28", 573 js: `[6`, 574 wantErr: true, 575 }, 576 { 577 name: "deadlock-issue-29", 578 js: `{""`, 579 wantErr: true, 580 }, 581 { 582 name: "written-beyond-slice-capacity-issue-33", 583 js: `{"":"\u20A"}`, 584 wantErr: true, 585 }, 586 { 587 name: "not-written-beyond-slice-capacity-issue-33", 588 js: `{"":"\u20AC"}`, 589 want: `{"":"€"}`, 590 wantErr: false, 591 }, 592 { 593 name: "unexpected-fault-address-issue-31", 594 js: `{"": { 595 "": [ 596 { 597 "": "", 598 "\ud"00\uDc00`, 599 wantErr: true, 600 }, 601 { 602 name: "index-out-of-range-issue-39", 603 js: `{"": null, 604 "c": false,"obj2": { 605 "d": "c", "g": 606 [ 607 "123 456-7890", null ] }, 608 "a": [], 609 "c": { "d": [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[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[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[`, 626 wantErr: true, 627 }, 628 { 629 name: "invalid-json-not-detected-issue-24", 630 js: `"{\"\":[],\"\":[5\x00]}"`, 631 wantErr: true, 632 }, 633 { 634 name: "missing-invalid-character-issue-25", 635 js: `{"":"\_000"}`, 636 wantErr: true, 637 }, 638 } 639 640 for _, tt := range tests { 641 t.Run(tt.name, func(t *testing.T) { 642 got, err := Parse([]byte(tt.js), nil) 643 if (err != nil) != tt.wantErr { 644 t.Errorf("ParseFailCases() error = %v, wantErr %v", err, tt.wantErr) 645 return 646 } 647 if tt.wantErr { 648 return 649 } 650 // Compare all 651 i := got.Iter() 652 b2, err := i.MarshalJSON() 653 if string(b2) != tt.want { 654 t.Errorf("ParseFailCases() got = %v, want %v", string(b2), tt.want) 655 } 656 657 i = got.Iter() 658 ref := []string{tt.js} 659 for i.Advance() == TypeRoot { 660 typ, obj, err := i.Root(nil) 661 if err != nil { 662 t.Fatal(err) 663 } 664 switch typ { 665 case TypeObject: 666 // We must send it throught marshall/unmarshall to match. 667 var want = ref[0] 668 var tmpMap map[string]interface{} 669 err := json.Unmarshal([]byte(want), &tmpMap) 670 if err != nil { 671 t.Fatal(err) 672 } 673 w2, err := json.Marshal(tmpMap) 674 if err != nil { 675 t.Fatal(err) 676 } 677 want = string(w2) 678 got, err := obj.Interface() 679 if err != nil { 680 t.Fatal(err) 681 } 682 gotAsJson, err := json.Marshal(got) 683 if err != nil { 684 t.Fatal(err) 685 } 686 if !reflect.DeepEqual(string(gotAsJson), want) { 687 t.Errorf("ParseFailCases() got = %#v, want %#v", string(gotAsJson), want) 688 } 689 } 690 ref = ref[1:] 691 } 692 }) 693 } 694 } 695 696 func TestParsePassCases(t *testing.T) { 697 if !SupportedCPU() { 698 t.SkipNow() 699 } 700 701 tests := []struct { 702 name string 703 skipFloats bool // Skip tests that contain float64 inprecisions (see GOLANG_NUMBER_PARSING flag) 704 onlyPrecise bool 705 js string 706 want string 707 wantErr bool 708 }{ 709 { 710 name: "segfault", 711 js: `{"F":"5\n\n\n\n\n\n\n\n\n11102230246251565404236316680908203125\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"}`, 712 wantErr: false, 713 want: `{"F":"5\n\n\n\n\n\n\n\n\n11102230246251565404236316680908203125\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"}`, 714 }, 715 { 716 name: "pass01.json", skipFloats: true, 717 js: `{"a":[ 718 "JSON Test Pattern pass1", 719 {"object with 1 member":["array with 1 element"]}, 720 {}, 721 [], 722 -42, 723 true, 724 false, 725 null, 726 { 727 "integer": 1234567890, 728 "real": -9876.543210, 729 "e": 0.123456789e-12, 730 "E": 1.234567890E+34, 731 "": 23456789012E66, 732 "zero": 0, 733 "one": 1, 734 "space": " ", 735 "quote": "\"", 736 "backslash": "\\", 737 "controls": "\b\f\n\r\t", 738 "slash": "/ & \/", 739 "alpha": "abcdefghijklmnopqrstuvwyz", 740 "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ", 741 "digit": "0123456789", 742 "0123456789": "digit", 743 "special": "1~!@#$%^&*()_+-={':[,]}|;.</>?", 744 "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A", 745 "true": true, 746 "false": false, 747 "null": null, 748 "array":[ ], 749 "object":{ }, 750 "address": "50 St. James Street", 751 "url": "http://www.JSON.org/", 752 "comment": "// /* <!-- --", 753 "# -- --> */": " ", 754 " s p a c e d " :[1,2 , 3 755 756 , 757 758 4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7], 759 "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", 760 "quotes": "" \u0022 %22 0x22 034 "", 761 "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t1~!@#$%^&*()_+-=[]{}|;:',./<>?" 762 : "A key can be any string" 763 }, 764 0.5 ,98.6 765 , 766 99.44 767 , 768 769 1066, 770 1e1, 771 0.1e1, 772 1e-1, 773 1e00,2e+00,2e-00 774 ,"rosebud"]}`, 775 want: `{"a":["JSON Test Pattern pass1",{"object with 1 member":["array with 1 element"]},{},[],-42,true,false,null,{"integer":1234567890,"real":-9876.54321,"e":1.23456789e-13,"E":1.23456789e+34,"":2.3456789012e+76,"zero":0,"one":1,"space":" ","quote":"\"","backslash":"\\","controls":"\b\f\n\r\t","slash":"/ & /","alpha":"abcdefghijklmnopqrstuvwyz","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","digit":"0123456789","0123456789":"digit","special":"1~!@#$%^&*()_+-={':[,]}|;.</>?","hex":"ģ䕧覫췯ꯍ","true":true,"false":false,"null":null,"array":[],"object":{},"address":"50 St. James Street","url":"http://www.JSON.org/","comment":"// /* <!-- --","# -- --> */":" "," s p a c e d ":[1,2,3,4,5,6,7],"compact":[1,2,3,4,5,6,7],"jsontext":"{\"object with 1 member\":[\"array with 1 element\"]}","quotes":"" \" %22 0x22 034 "","/\\\"쫾몾ꮘﳞ볚\b\f\n\r\t1~!@#$%^&*()_+-=[]{}|;:',./<>?":"A key can be any string"},0.5,98.6,99.44,1066,10,1,0.1,1,2,2,"rosebud"]}`, 776 wantErr: false, 777 }, 778 { 779 name: "pass02.json", 780 js: `{"a":[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]}`, 781 want: `{"a":[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]}`, 782 wantErr: false, 783 }, 784 { 785 name: "pass03.json", 786 js: `{ 787 "JSON Test Pattern pass3": { 788 "The outermost value": "must be an object or array.", 789 "In this test": "It is an object." 790 } 791 }`, 792 want: `{"JSON Test Pattern pass3":{"The outermost value":"must be an object or array.","In this test":"It is an object."}}`, 793 wantErr: false, 794 }, 795 { 796 name: "pass04.json", skipFloats: true, 797 js: `{"a":[3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679,0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003]}`, 798 want: `{"a":[3.141592653589793,3e-117]}`, 799 wantErr: false, 800 }, 801 //{ 802 // name: "pass05.json", 803 // js: `12345678900000002170460276904689664.000000`, 804 // wantErr: false, 805 //}, 806 //{ 807 // name: "pass06.json", 808 // js: `true`, 809 // wantErr: false, 810 //}, 811 //{ 812 // name: "pass07.json", 813 // js: `null`, 814 // wantErr: false, 815 //}, 816 //{ 817 // name: "pass08.json", 818 // js: `1`, 819 // wantErr: false, 820 //}, 821 //{ 822 // name: "pass09.json", 823 // js: `false`, 824 // wantErr: false, 825 //}, 826 //{ 827 // name: "pass10.json", 828 // js: `"124"`, 829 // wantErr: false, 830 //}, 831 //{ 832 // name: "pass11.json", 833 // js: `4611686018427387904`, 834 // wantErr: false, 835 //}, 836 //{ 837 // name: "pass12.json", 838 // js: `2147483648`, 839 // wantErr: false, 840 //}, 841 //{ 842 // name: "pass13.json", 843 // js: `12300`, 844 // wantErr: false, 845 //}, 846 { 847 name: "pass14.json", 848 js: `{"string with backandquote \\\"":1, "string with back\\":2}`, 849 want: `{"string with backandquote \\\"":1,"string with back\\":2}`, 850 wantErr: false, 851 }, 852 { 853 name: "pass15.json", skipFloats: true, 854 js: `{"a":[-65.619720000000029]}`, 855 want: `{"a":[-65.61972000000003]}`, 856 wantErr: false, 857 }, 858 //{ 859 // name: "pass16.json", 860 // js: `0`, 861 // wantErr: false, 862 //}, 863 { 864 name: "pass17.json", 865 js: `{"a":[1.0e-307,0.1e-307,0.01e-306,1.79769e+308,-1.79769e+308]}`, 866 want: `{"a":[1e-307,1e-308,1e-308,1.79769e+308,-1.79769e+308]}`, 867 wantErr: false, 868 }, 869 { 870 name: "pass18.json", skipFloats: true, 871 js: `{"a":[1000000000000000000e0,1000000000000000000e-0,1000000000000000000.0e0,1000000000000000000e10,"issue187"]}`, 872 want: `{"a":[1000000000000000000,1000000000000000000,1000000000000000000,1e+28,"issue187"]}`, 873 wantErr: false, 874 }, 875 //{ 876 // name: "pass19.json", 877 // js: `-1`, 878 // wantErr: false, 879 //}, 880 //{ 881 // name: "pass20.json", 882 // js: `1.2e000000010`, 883 // wantErr: false, 884 //}, 885 //{ 886 // name: "pass21.json", 887 // js: `9223372036854775808`, 888 // wantErr: false, 889 //}, 890 //{ 891 // name: "pass22.json", 892 // js: `18446744073709551615`, 893 // wantErr: false, 894 //}, 895 //{ 896 // name: "pass23.json", 897 // js: `-5.96916642387374e-309`, 898 // wantErr: false, 899 //}, 900 //{ 901 // name: "pass24.json", 902 // js: `-7.9431`, 903 // wantErr: false, 904 //}, 905 //{ 906 // name: "pass25.json", 907 // js: `4E-2147483674`, 908 // wantErr: false, 909 //}, 910 { 911 name: "small-nested-issue-51", 912 js: `{"M":{"T":false}}`, 913 want: `{"M":{"T":false}}`, 914 wantErr: false, 915 }, 916 { 917 name: "big-float-inprecision-46", 918 onlyPrecise: true, 919 js: `{"":60000000000000000000}`, 920 want: `{"":60000000000000000000}`, 921 wantErr: false, 922 }, 923 { 924 name: "big-integer-overflow-47", 925 onlyPrecise: true, 926 js: `{"o":30886023086020860230}`, 927 want: `{"o":30886023086020860000}`, 928 wantErr: false, 929 }, 930 { 931 name: "small-number-array-issue-49", 932 onlyPrecise: true, 933 js: `{"G":[0,5e-500,5e-50]}`, 934 want: `{"G":[0,0,5e-50]}`, 935 wantErr: false, 936 }, 937 { 938 name: "fail18", // Not too deep for simdjson-go 939 js: `[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]`, 940 want: `[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]`, 941 wantErr: false, 942 }, 943 //{ 944 // name: "fail34", 945 // // `["this string contains bad UTF-8 €"]` 946 // js: string([]byte{0x5b, 0x22, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x62, 0x61, 0x64, 0x20, 0x55, 0x54, 0x46, 0x2d, 0x38, 0x20, 0x80, 0x22, 0x5d, 0x0a}), 947 // want: `["this string contains bad UTF-8 �"]`, 948 // wantErr: false, 949 //}, 950 { 951 name: "fail72", 952 js: `["with bad trailing space" ]`, 953 want: `["with bad trailing space"]`, 954 wantErr: false, 955 }, 956 } 957 958 var got *ParsedJson 959 960 for _, tt := range tests { 961 t.Run(tt.name, func(t *testing.T) { 962 if tt.skipFloats { 963 return 964 } 965 var err error 966 got, err = Parse([]byte(tt.js), got) 967 if (err != nil) != tt.wantErr { 968 t.Errorf("TestParsePassCases() error = %v, wantErr %v", err, tt.wantErr) 969 return 970 } 971 if tt.wantErr { 972 return 973 } 974 // Compare all 975 i := got.Iter() 976 b2, err := i.MarshalJSON() 977 if string(b2) != tt.want { 978 t.Errorf("TestParsePassCases() got = %v, want %v", string(b2), tt.want) 979 } 980 981 i = got.Iter() 982 ref := []string{tt.js} 983 for i.Advance() == TypeRoot { 984 typ, obj, err := i.Root(nil) 985 if err != nil { 986 t.Fatal(err) 987 } 988 switch typ { 989 case TypeObject: 990 // We must send it through marshall/unmarshal to match. 991 var want = ref[0] 992 var tmpMap map[string]interface{} 993 err := json.Unmarshal([]byte(want), &tmpMap) 994 if err != nil { 995 t.Fatal(err) 996 } 997 w2, err := json.Marshal(tmpMap) 998 if err != nil { 999 t.Fatal(err) 1000 } 1001 want = string(w2) 1002 got, err := obj.Interface() 1003 if err != nil { 1004 t.Fatal(err) 1005 } 1006 gotAsJson, err := json.Marshal(got) 1007 if err != nil { 1008 t.Fatal(err) 1009 } 1010 if !reflect.DeepEqual(string(gotAsJson), want) { 1011 t.Errorf("TestParsePassCases() got = %#v, want %#v", string(gotAsJson), want) 1012 } 1013 } 1014 ref = ref[1:] 1015 } 1016 }) 1017 } 1018 }