1// Copyright (c) 2023 Huawei Device Co., Ltd.
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6//     http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14pub const LOOPS_NUM: usize = 10;
15
16pub const NULL_EXAMPLE: &str = "null";
17pub const BOOLEAN_EXAMPLE: &str = "false";
18pub const NUMBER_EXAMPLE: &str = "12.34";
19pub const STRING_EXAMPLE: &str = "\"Hello\"";
20pub const ARRAY_EXAMPLE: &str = "[false,null,12.34]";
21pub const OBJECT_EXAMPLE: &str = r#"{"key":"value"}"#;
22
23pub const RFC7159_EXAMPLE1: &str = r#"
24{
25    "Image": {
26        "Width":  800,
27        "Height": 600,
28        "Title":  "View from 15th Floor",
29        "Thumbnail": {
30            "Url":    "http://www.example.com/image/481989943",
31            "Height": 125,
32            "Width":  100
33        },
34        "Animated" : false,
35        "IDs": [116, 943, 234, 38793]
36    }
37}
38"#;
39
40pub const RFC7159_EXAMPLE2: &str = r#"
41[
42    {
43       "precision": "zip",
44       "Latitude":  37.7668,
45       "Longitude": -122.3959,
46       "Address":   "",
47       "City":      "SAN FRANCISCO",
48       "State":     "CA",
49       "Zip":       "94107",
50       "Country":   "US"
51    },
52    {
53       "precision": "zip",
54       "Latitude":  37.371991,
55       "Longitude": -122.026020,
56       "Address":   "",
57       "City":      "SUNNYVALE",
58       "State":     "CA",
59       "Zip":       "94085",
60       "Country":   "US"
61    }
62]
63"#;
64
65pub const JSON_PARSE_TEST: &str = r#"
66[
67    {
68        "null1": null
69    },
70    {
71        "boolean1": true,
72        "boolean2": false
73    },
74    {
75        "number1": 0,
76        "number2": -0,
77        "number3": 123,
78        "number4": -123,
79        "number5": 123.456,
80        "number6": -123.456,
81        "number7": 123.456e+7,
82        "number8": 123.456e-7,
83        "number9": 123.456E+7,
84        "number10": 123.456E-7,
85        "number11": -123.456e+7,
86        "number12": -123.456e-7,
87        "number13": -123.456E+7,
88        "number14": -123.456E-7,
89        "number15": 0.0,
90        "number16": -0.0e+7,
91        "number17": 3e2
92    },
93    {
94        "string1": "",
95        "string2": "Hello World",
96        "string3": "abcdefghijklmnopqrstuvwxyz",
97        "string4": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
98        "string5": "0123456789",
99        "string6": " \b\f\n\r\t",
100        "string7": "\"\\\/",
101        "string8": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
102        "string9": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A"
103    },
104    {
105        "array1": [],
106        "array2": [
107                                     ],
108        "array3": [null,true,0.0,"string",[],{}],
109        "array4": [
110                null                    ,               true,           0.0           ,
111        "string",                            []
112                             ,        {}   ],
113        "array5": [[[[[[["nest"]]]]]]]
114    },
115    {
116        "object1": {},
117        "object2": {
118                                                   },
119        "object3": {"key1":null,"key2":true,"key3":0.0,"key4":"string","key5":[],"key6":{}},
120        "object4": {
121                "key1"                :                 null   ,       "key2"
122                           :                  true     ,            "key3"         :
123         0.0      ,      "key4":"string"            ,
124                       "key5":                [],          "key6":            {
125                                       }
126        },
127        "object5": {"nest1": {"nest2": {"nest3": {"nest4": {}}}}}
128    },
129    {
130        "": "key1",
131        "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" : "key2"
132    },
133    {
134                                    "key_value1"
135                            :                        "value"
136                ,         "key_value2"     :           [
137                      ]             ,                     "key_value3"                  :
138                      {}
139    }
140]
141"#;
142
143pub const LONG_KEY_VALUE: &str = r#"
144{
145    "long_key_value_object":{
146    "-----LONG KEY-----uoTVt77ryiZ5GnfVXf6kEBJQS8hBMY2BMsyLyckIPrNEvknjp82jz9yatYV0S77uLb99nPR6WqSDPtrWzc1XHJVPLoIlxaDGKm4xB7KaFl95wdnYRvuyCEmrzdoZS1KtXyf31vYLD4r9BnFm6wBuefKvONcLNGi5bsZqq100MWmFXjQUYhd6nZDJWVTAtpF195PiyvoJiJxSkiwpallQCqTbcoZTMf5SJ7KH1umstVVPW6NvgRO5PwwHc2N7QytBvw":
147    "-----LONG VALUE-----by4iUNvpmeZ5ypvznYm7DSiY6gEgRy64yFGHB6pSgMGVRvElAnrSXpaSC8Exa9aMbx4hGkStSKMSbsk2t8JVxDqBKQVo7NdJiSwQf2p5YxFIU5aS2y4gazdDHcwuo7pqrp47AuXfxC799qUDD4q6VWD9u49Nuy7DXLjrdgLz17cC3uCaMwSZK3wc6Lu0Mri6Di4M9NEe36WGBN1xcmcHvm8GH7XXGikuuZ432HG76DEek1s99jHTzQZEILiDQAB",
148
149    "-----LONG KEY-----by4iUNvpmeZ5ypvznYm7DSiY6gEgRy64yFGHB6pSgMGVRvElAnrSXpaSC8Exa9aMbx4hGkStSKMSbsk2t8JVxDqBKQVo7NdJiSwQf2p5YxFIU5aS2y4gazdDHcwuo7pqrp47AuXfxC799qUDD4q6VWD9u49Nuy7DXLjrdgLz17cC3uCaMwSZK3wc6Lu0Mri6Di4M9NEe36WGBN1xcmcHvm8GH7XXGikuuZ432HG76DEek1s99jHTzQZEILiDQAB":
150    "-----LONG VALUE-----uoTVt77ryiZ5GnfVXf6kEBJQS8hBMY2BMsyLyckIPrNEvknjp82jz9yatYV0S77uLb99nPR6WqSDPtrWzc1XHJVPLoIlxaDGKm4xB7KaFl95wdnYRvuyCEmrzdoZS1KtXyf31vYLD4r9BnFm6wBuefKvONcLNGi5bsZqq100MWmFXjQUYhd6nZDJWVTAtpF195PiyvoJiJxSkiwpallQCqTbcoZTMf5SJ7KH1umstVVPW6NvgRO5PwwHc2N7QytBvw"
151    }
152}
153"#;
154