github.com/bytedance/sonic@v1.11.7-0.20240517092252-d2edb31b167b/ast/testdata_test.go (about)

     1  /*
     2   * Copyright 2021 ByteDance Inc.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *     http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  package ast
    18  
    19  const _TwitterJson = `{
    20    "statuses": [
    21      {
    22        "coordinates": null,
    23        "favorited": false,
    24        "truncated": false,
    25        "created_at": "Mon Sep 24 03:35:21 +0000 2012",
    26        "id_str": "250075927172759552",
    27        "entities": {
    28          "urls": [
    29   
    30          ],
    31          "hashtags": [
    32            {
    33              "text": "freebandnames",
    34              "indices": [
    35                20,
    36                34
    37              ]
    38            }
    39          ],
    40          "user_mentions": [
    41   
    42          ]
    43        },
    44        "in_reply_to_user_id_str": null,
    45        "contributors": null,
    46        "text": "Aggressive Ponytail #freebandnames",
    47        "metadata": {
    48          "iso_language_code": "en",
    49          "result_type": "recent"
    50        },
    51        "retweet_count": 0,
    52        "in_reply_to_status_id_str": null,
    53        "id": 250075927172759552,
    54        "geo": null,
    55        "retweeted": false,
    56        "in_reply_to_user_id": null,
    57        "place": null,
    58        "user": {
    59          "profile_sidebar_fill_color": "DDEEF6",
    60          "profile_sidebar_border_color": "C0DEED",
    61          "profile_background_tile": false,
    62          "name": "Sean Cummings",
    63          "profile_image_url": "http://a0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg",
    64          "created_at": "Mon Apr 26 06:01:55 +0000 2010",
    65          "location": "LA, CA",
    66          "follow_request_sent": null,
    67          "profile_link_color": "0084B4",
    68          "is_translator": false,
    69          "id_str": "137238150",
    70          "entities": {
    71            "url": {
    72              "urls": [
    73                {
    74                  "expanded_url": null,
    75                  "url": "",
    76                  "indices": [
    77                    0,
    78                    0
    79                  ]
    80                }
    81              ]
    82            },
    83            "description": {
    84              "urls": [
    85   
    86              ]
    87            }
    88          },
    89          "default_profile": true,
    90          "contributors_enabled": false,
    91          "favourites_count": 0,
    92          "url": null,
    93          "profile_image_url_https": "https://si0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg",
    94          "utc_offset": -28800,
    95          "id": 137238150,
    96          "profile_use_background_image": true,
    97          "listed_count": 2,
    98          "profile_text_color": "333333",
    99          "lang": "en",
   100          "followers_count": 70,
   101          "protected": false,
   102          "notifications": null,
   103          "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme1/bg.png",
   104          "profile_background_color": "C0DEED",
   105          "verified": false,
   106          "geo_enabled": true,
   107          "time_zone": "Pacific Time (US & Canada)",
   108          "description": "Born 330 Live 310",
   109          "default_profile_image": false,
   110          "profile_background_image_url": "http://a0.twimg.com/images/themes/theme1/bg.png",
   111          "statuses_count": 579,
   112          "friends_count": 110,
   113          "following": null,
   114          "show_all_inline_media": false,
   115          "screen_name": "sean_cummings"
   116        },
   117        "in_reply_to_screen_name": null,
   118        "source": "<a href=\"//itunes.apple.com/us/app/twitter/id409789998?mt=12%5C%22\" rel=\"\\\"nofollow\\\"\">Twitter for Mac</a>",
   119        "in_reply_to_status_id": null
   120      },
   121      {
   122        "coordinates": null,
   123        "favorited": false,
   124        "truncated": false,
   125        "created_at": "Fri Sep 21 23:40:54 +0000 2012",
   126        "id_str": "249292149810667520",
   127        "entities": {
   128          "urls": [
   129   
   130          ],
   131          "hashtags": [
   132            {
   133              "text": "FreeBandNames",
   134              "indices": [
   135                20,
   136                34
   137              ]
   138            }
   139          ],
   140          "user_mentions": [
   141   
   142          ]
   143        },
   144        "in_reply_to_user_id_str": null,
   145        "contributors": null,
   146        "text": "Thee Namaste Nerdz. #FreeBandNames",
   147        "metadata": {
   148          "iso_language_code": "pl",
   149          "result_type": "recent"
   150        },
   151        "retweet_count": 0,
   152        "in_reply_to_status_id_str": null,
   153        "id": 249292149810667520,
   154        "geo": null,
   155        "retweeted": false,
   156        "in_reply_to_user_id": null,
   157        "place": null,
   158        "user": {
   159          "profile_sidebar_fill_color": "DDFFCC",
   160          "profile_sidebar_border_color": "BDDCAD",
   161          "profile_background_tile": true,
   162          "name": "Chaz Martenstein",
   163          "profile_image_url": "http://a0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg",
   164          "created_at": "Tue Apr 07 19:05:07 +0000 2009",
   165          "location": "Durham, NC",
   166          "follow_request_sent": null,
   167          "profile_link_color": "0084B4",
   168          "is_translator": false,
   169          "id_str": "29516238",
   170          "entities": {
   171            "url": {
   172              "urls": [
   173                {
   174                  "expanded_url": null,
   175                  "url": "http://bullcityrecords.com/wnng/",
   176                  "indices": [
   177                    0,
   178                    32
   179                  ]
   180                }
   181              ]
   182            },
   183            "description": {
   184              "urls": [
   185   
   186              ]
   187            }
   188          },
   189          "default_profile": false,
   190          "contributors_enabled": false,
   191          "favourites_count": 8,
   192          "url": "http://bullcityrecords.com/wnng/",
   193          "profile_image_url_https": "https://si0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg",
   194          "utc_offset": -18000,
   195          "id": 29516238,
   196          "profile_use_background_image": true,
   197          "listed_count": 118,
   198          "profile_text_color": "333333",
   199          "lang": "en",
   200          "followers_count": 2052,
   201          "protected": false,
   202          "notifications": null,
   203          "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/9423277/background_tile.bmp",
   204          "profile_background_color": "9AE4E8",
   205          "verified": false,
   206          "geo_enabled": false,
   207          "time_zone": "Eastern Time (US & Canada)",
   208          "description": "You will come to Durham, North Carolina. I will sell you some records then, here in Durham, North Carolina. Fun will happen.",
   209          "default_profile_image": false,
   210          "profile_background_image_url": "http://a0.twimg.com/profile_background_images/9423277/background_tile.bmp",
   211          "statuses_count": 7579,
   212          "friends_count": 348,
   213          "following": null,
   214          "show_all_inline_media": true,
   215          "screen_name": "bullcityrecords"
   216        },
   217        "in_reply_to_screen_name": null,
   218        "source": "web",
   219        "in_reply_to_status_id": null
   220      },
   221      {
   222        "coordinates": null,
   223        "favorited": false,
   224        "truncated": false,
   225        "created_at": "Fri Sep 21 23:30:20 +0000 2012",
   226        "id_str": "249289491129438208",
   227        "entities": {
   228          "urls": [
   229   
   230          ],
   231          "hashtags": [
   232            {
   233              "text": "freebandnames",
   234              "indices": [
   235                29,
   236                43
   237              ]
   238            }
   239          ],
   240          "user_mentions": [
   241   
   242          ]
   243        },
   244        "in_reply_to_user_id_str": null,
   245        "contributors": null,
   246        "text": "Mexican Heaven, Mexican Hell #freebandnames",
   247        "metadata": {
   248          "iso_language_code": "en",
   249          "result_type": "recent"
   250        },
   251        "retweet_count": 0,
   252        "in_reply_to_status_id_str": null,
   253        "id": 249289491129438208,
   254        "geo": null,
   255        "retweeted": false,
   256        "in_reply_to_user_id": null,
   257        "place": null,
   258        "user": {
   259          "profile_sidebar_fill_color": "99CC33",
   260          "profile_sidebar_border_color": "829D5E",
   261          "profile_background_tile": false,
   262          "name": "Thomas John Wakeman",
   263          "profile_image_url": "http://a0.twimg.com/profile_images/2219333930/Froggystyle_normal.png",
   264          "created_at": "Tue Sep 01 21:21:35 +0000 2009",
   265          "location": "Kingston New York",
   266          "follow_request_sent": null,
   267          "profile_link_color": "D02B55",
   268          "is_translator": false,
   269          "id_str": "70789458",
   270          "entities": {
   271            "url": {
   272              "urls": [
   273                {
   274                  "expanded_url": null,
   275                  "url": "",
   276                  "indices": [
   277                    0,
   278                    0
   279                  ]
   280                }
   281              ]
   282            },
   283            "description": {
   284              "urls": [
   285   
   286              ]
   287            }
   288          },
   289          "default_profile": false,
   290          "contributors_enabled": false,
   291          "favourites_count": 19,
   292          "url": null,
   293          "profile_image_url_https": "https://si0.twimg.com/profile_images/2219333930/Froggystyle_normal.png",
   294          "utc_offset": -18000,
   295          "id": 70789458,
   296          "profile_use_background_image": true,
   297          "listed_count": 1,
   298          "profile_text_color": "3E4415",
   299          "lang": "en",
   300          "followers_count": 63,
   301          "protected": false,
   302          "notifications": null,
   303          "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme5/bg.gif",
   304          "profile_background_color": "352726",
   305          "verified": false,
   306          "geo_enabled": false,
   307          "time_zone": "Eastern Time (US & Canada)",
   308          "description": "Science Fiction Writer, sort of. Likes Superheroes, Mole People, Alt. Timelines.",
   309          "default_profile_image": false,
   310          "profile_background_image_url": "http://a0.twimg.com/images/themes/theme5/bg.gif",
   311          "statuses_count": 1048,
   312          "friends_count": 63,
   313          "following": null,
   314          "show_all_inline_media": false,
   315          "screen_name": "MonkiesFist"
   316        },
   317        "in_reply_to_screen_name": null,
   318        "source": "web",
   319        "in_reply_to_status_id": null
   320      },
   321      {
   322        "coordinates": null,
   323        "favorited": false,
   324        "truncated": false,
   325        "created_at": "Fri Sep 21 22:51:18 +0000 2012",
   326        "id_str": "249279667666817024",
   327        "entities": {
   328          "urls": [
   329   
   330          ],
   331          "hashtags": [
   332            {
   333              "text": "freebandnames",
   334              "indices": [
   335                20,
   336                34
   337              ]
   338            }
   339          ],
   340          "user_mentions": [
   341   
   342          ]
   343        },
   344        "in_reply_to_user_id_str": null,
   345        "contributors": null,
   346        "text": "The Foolish Mortals #freebandnames",
   347        "metadata": {
   348          "iso_language_code": "en",
   349          "result_type": "recent"
   350        },
   351        "retweet_count": 0,
   352        "in_reply_to_status_id_str": null,
   353        "id": 249279667666817024,
   354        "geo": null,
   355        "retweeted": false,
   356        "in_reply_to_user_id": null,
   357        "place": null,
   358        "user": {
   359          "profile_sidebar_fill_color": "BFAC83",
   360          "profile_sidebar_border_color": "615A44",
   361          "profile_background_tile": true,
   362          "name": "Marty Elmer",
   363          "profile_image_url": "http://a0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png",
   364          "created_at": "Mon May 04 00:05:00 +0000 2009",
   365          "location": "Wisconsin, USA",
   366          "follow_request_sent": null,
   367          "profile_link_color": "3B2A26",
   368          "is_translator": false,
   369          "id_str": "37539828",
   370          "entities": {
   371            "url": {
   372              "urls": [
   373                {
   374                  "expanded_url": null,
   375                  "url": "http://www.omnitarian.me",
   376                  "indices": [
   377                    0,
   378                    24
   379                  ]
   380                }
   381              ]
   382            },
   383            "description": {
   384              "urls": [
   385   
   386              ]
   387            }
   388          },
   389          "default_profile": false,
   390          "contributors_enabled": false,
   391          "favourites_count": 647,
   392          "url": "http://www.omnitarian.me",
   393          "profile_image_url_https": "https://si0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png",
   394          "utc_offset": -21600,
   395          "id": 37539828,
   396          "profile_use_background_image": true,
   397          "listed_count": 52,
   398          "profile_text_color": "000000",
   399          "lang": "en",
   400          "followers_count": 608,
   401          "protected": false,
   402          "notifications": null,
   403          "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/106455659/rect6056-9.png",
   404          "profile_background_color": "EEE3C4",
   405          "verified": false,
   406          "geo_enabled": false,
   407          "time_zone": "Central Time (US & Canada)",
   408          "description": "Cartoonist, Illustrator, and T-Shirt connoisseur",
   409          "default_profile_image": false,
   410          "profile_background_image_url": "http://a0.twimg.com/profile_background_images/106455659/rect6056-9.png",
   411          "statuses_count": 3575,
   412          "friends_count": 249,
   413          "following": null,
   414          "show_all_inline_media": true,
   415          "screen_name": "Omnitarian"
   416        },
   417        "in_reply_to_screen_name": null,
   418        "source": "<a href=\"//twitter.com/download/iphone%5C%22\" rel=\"\\\"nofollow\\\"\">Twitter for iPhone</a>",
   419        "in_reply_to_status_id": null
   420      }
   421    ],
   422    "search_metadata": {
   423      "max_id": 250126199840518145,
   424      "since_id": 24012619984051000,
   425      "refresh_url": "?since_id=250126199840518145&q=%23freebandnames&result_type=mixed&include_entities=1",
   426      "next_results": "?max_id=249279667666817023&q=%23freebandnames&count=4&include_entities=1&result_type=mixed",
   427      "count": 4,
   428      "completed_in": 0.035,
   429      "since_id_str": "24012619984051000",
   430      "query": "%23freebandnames",
   431      "max_id_str": "250126199840518145"
   432    }
   433  }`
   434  
   435  const _LotsCompare = `{"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"hi":0,"is":1}`
   436  
   437  type _TwitterStruct struct {
   438      Statuses []struct {
   439          Coordinates interface{} `json:"coordinates"`
   440          Favorited   bool        `json:"favorited"`
   441          Truncated   bool        `json:"truncated"`
   442          CreatedAt   string      `json:"created_at"`
   443          IDStr       string      `json:"id_str"`
   444          Entities    struct {
   445              Urls     []interface{} `json:"urls"`
   446              Hashtags []struct {
   447                  Text    string `json:"text"`
   448                  Indices []int  `json:"indices"`
   449              } `json:"hashtags"`
   450              UserMentions []interface{} `json:"user_mentions"`
   451          } `json:"entities"`
   452          InReplyToUserIDStr interface{} `json:"in_reply_to_user_id_str"`
   453          Contributors       interface{} `json:"contributors"`
   454          Text               string      `json:"text"`
   455          Metadata           struct {
   456              IsoLanguageCode string `json:"iso_language_code"`
   457              ResultType      string `json:"result_type"`
   458          } `json:"metadata"`
   459          RetweetCount         int         `json:"retweet_count"`
   460          InReplyToStatusIDStr interface{} `json:"in_reply_to_status_id_str"`
   461          ID                   int64       `json:"id"`
   462          Geo                  interface{} `json:"geo"`
   463          Retweeted            bool        `json:"retweeted"`
   464          InReplyToUserID      interface{} `json:"in_reply_to_user_id"`
   465          Place                interface{} `json:"place"`
   466          User                 struct {
   467              ProfileSidebarFillColor   string      `json:"profile_sidebar_fill_color"`
   468              ProfileSidebarBorderColor string      `json:"profile_sidebar_border_color"`
   469              ProfileBackgroundTile     bool        `json:"profile_background_tile"`
   470              Name                      string      `json:"name"`
   471              ProfileImageURL           string      `json:"profile_image_url"`
   472              CreatedAt                 string      `json:"created_at"`
   473              Location                  string      `json:"location"`
   474              FollowRequestSent         interface{} `json:"follow_request_sent"`
   475              ProfileLinkColor          string      `json:"profile_link_color"`
   476              IsTranslator              bool        `json:"is_translator"`
   477              IDStr                     string      `json:"id_str"`
   478              Entities                  struct {
   479                  URL struct {
   480                      Urls []struct {
   481                          ExpandedURL interface{} `json:"expanded_url"`
   482                          URL         string      `json:"url"`
   483                          Indices     []int       `json:"indices"`
   484                      } `json:"urls"`
   485                  } `json:"url"`
   486                  Description struct {
   487                      Urls []interface{} `json:"urls"`
   488                  } `json:"description"`
   489              } `json:"entities"`
   490              DefaultProfile                 bool        `json:"default_profile"`
   491              ContributorsEnabled            bool        `json:"contributors_enabled"`
   492              FavouritesCount                int         `json:"favourites_count"`
   493              URL                            interface{} `json:"url"`
   494              ProfileImageURLHTTPS           string      `json:"profile_image_url_https"`
   495              UtcOffset                      int         `json:"utc_offset"`
   496              ID                             int         `json:"id"`
   497              ProfileUseBackgroundImage      bool        `json:"profile_use_background_image"`
   498              ListedCount                    int         `json:"listed_count"`
   499              ProfileTextColor               string      `json:"profile_text_color"`
   500              Lang                           string      `json:"lang"`
   501              FollowersCount                 int         `json:"followers_count"`
   502              Protected                      bool        `json:"protected"`
   503              Notifications                  interface{} `json:"notifications"`
   504              ProfileBackgroundImageURLHTTPS string      `json:"profile_background_image_url_https"`
   505              ProfileBackgroundColor         string      `json:"profile_background_color"`
   506              Verified                       bool        `json:"verified"`
   507              GeoEnabled                     bool        `json:"geo_enabled"`
   508              TimeZone                       string      `json:"time_zone"`
   509              Description                    string      `json:"description"`
   510              DefaultProfileImage            bool        `json:"default_profile_image"`
   511              ProfileBackgroundImageURL      string      `json:"profile_background_image_url"`
   512              StatusesCount                  int         `json:"statuses_count"`
   513              FriendsCount                   int         `json:"friends_count"`
   514              Following                      interface{} `json:"following"`
   515              ShowAllInlineMedia             bool        `json:"show_all_inline_media"`
   516              ScreenName                     string      `json:"screen_name"`
   517          } `json:"user"`
   518          InReplyToScreenName interface{} `json:"in_reply_to_screen_name"`
   519          Source              string      `json:"source"`
   520          InReplyToStatusID   interface{} `json:"in_reply_to_status_id"`
   521      } `json:"statuses"`
   522      SearchMetadata struct {
   523          MaxID       int64   `json:"max_id"`
   524          SinceID     int64   `json:"since_id"`
   525          RefreshURL  string  `json:"refresh_url"`
   526          NextResults string  `json:"next_results"`
   527          Count       int     `json:"count"`
   528          CompletedIn float64 `json:"completed_in"`
   529          SinceIDStr  string  `json:"since_id_str"`
   530          Query       string  `json:"query"`
   531          MaxIDStr    string  `json:"max_id_str"`
   532      } `json:"search_metadata"`
   533  }
   534