...

Text file src/go.mongodb.org/mongo-driver/testdata/bson-corpus/symbol.json

Documentation: go.mongodb.org/mongo-driver/testdata/bson-corpus

     1{
     2    "description": "Symbol",
     3    "bson_type": "0x0E",
     4    "deprecated": true,
     5    "test_key": "a",
     6    "valid": [
     7        {
     8            "description": "Empty string",
     9            "canonical_bson": "0D0000000E6100010000000000",
    10            "canonical_extjson": "{\"a\": {\"$symbol\": \"\"}}",
    11            "converted_bson": "0D000000026100010000000000",
    12            "converted_extjson": "{\"a\": \"\"}"
    13        },
    14        {
    15            "description": "Single character",
    16            "canonical_bson": "0E0000000E610002000000620000",
    17            "canonical_extjson": "{\"a\": {\"$symbol\": \"b\"}}",
    18            "converted_bson": "0E00000002610002000000620000",
    19            "converted_extjson": "{\"a\": \"b\"}"
    20        },
    21        {
    22            "description": "Multi-character",
    23            "canonical_bson": "190000000E61000D0000006162616261626162616261620000",
    24            "canonical_extjson": "{\"a\": {\"$symbol\": \"abababababab\"}}",
    25            "converted_bson": "190000000261000D0000006162616261626162616261620000",
    26            "converted_extjson": "{\"a\": \"abababababab\"}"
    27        },
    28        {
    29            "description": "two-byte UTF-8 (\u00e9)",
    30            "canonical_bson": "190000000E61000D000000C3A9C3A9C3A9C3A9C3A9C3A90000",
    31            "canonical_extjson": "{\"a\": {\"$symbol\": \"éééééé\"}}",
    32            "converted_bson": "190000000261000D000000C3A9C3A9C3A9C3A9C3A9C3A90000",
    33            "converted_extjson": "{\"a\": \"éééééé\"}"
    34        },
    35        {
    36            "description": "three-byte UTF-8 (\u2606)",
    37            "canonical_bson": "190000000E61000D000000E29886E29886E29886E298860000",
    38            "canonical_extjson": "{\"a\": {\"$symbol\": \"☆☆☆☆\"}}",
    39            "converted_bson": "190000000261000D000000E29886E29886E29886E298860000",
    40            "converted_extjson": "{\"a\": \"☆☆☆☆\"}"
    41        },
    42        {
    43            "description": "Embedded nulls",
    44            "canonical_bson": "190000000E61000D0000006162006261620062616261620000",
    45            "canonical_extjson": "{\"a\": {\"$symbol\": \"ab\\u0000bab\\u0000babab\"}}",
    46            "converted_bson": "190000000261000D0000006162006261620062616261620000",
    47            "converted_extjson": "{\"a\": \"ab\\u0000bab\\u0000babab\"}"
    48        }
    49    ],
    50    "decodeErrors": [
    51        {
    52            "description": "bad symbol length: 0 (but no 0x00 either)",
    53            "bson": "0C0000000E61000000000000"
    54        },
    55        {
    56            "description": "bad symbol length: -1",
    57            "bson": "0C0000000E6100FFFFFFFF00"
    58        },
    59        {
    60            "description": "bad symbol length: eats terminator",
    61            "bson": "100000000E6100050000006200620000"
    62        },
    63        {
    64            "description": "bad symbol length: longer than rest of document",
    65            "bson": "120000000E00FFFFFF00666F6F6261720000"
    66        },
    67        {
    68            "description": "symbol is not null-terminated",
    69            "bson": "100000000E610004000000616263FF00"
    70        },
    71        {
    72            "description": "empty symbol, but extra null",
    73            "bson": "0E0000000E610001000000000000"
    74        },
    75        {
    76            "description": "invalid UTF-8",
    77            "bson": "0E0000000E610002000000E90000"
    78        }
    79    ]
    80}

View as plain text