...

Text file src/cuelang.org/go/encoding/protobuf/textproto/testdata/decoder/simple.txtar

Documentation: cuelang.org/go/encoding/protobuf/textproto/testdata/decoder

     1// From: https://stackoverflow.com/questions/18873924/what-does-the-protobuf-text-format-look-like
     2-- foo.cue --
     3#MyEnum: "Default" | "Variant1" | "Variant100"
     4
     5f1: string
     6f2: int64
     7fa: [...uint64]
     8fb: [...int32]
     9fc: [...number]
    10pairs: [...#Pair]
    11bbbb: bytes // optional
    12
    13//    extensions 100 to max;
    14
    15#Pair: {
    16	key:   string
    17	value: string
    18}
    19-- input.textproto --
    20f1: "dsfadsafsaf"
    21f2: 234 # value comment
    22
    23fa: 2342134
    24fa: 2342135
    25fa: 2342136
    26# Mix of list and single elements.
    27fb: [ -2342134, -2342135, -2342136 ]
    28fb: -1000
    29
    30fc: 4
    31fc: 7
    32fc: -12
    33fc: 4
    34fc: 7
    35fc: -3
    36fc: 4
    37fc: 7
    38fc: 0
    39pairs {
    40    key: "sdfff"
    41    value: "q\"qq\\q\n"
    42}
    43pairs {
    44    key: "   sdfff2  \321\202\320\265\321\201\321\202 "
    45    value: "q\tqq<>q2&\001\377"
    46}
    47bbbb: "\000\001\002\377\376\375"
    48-- out/decode --
    49f1: "dsfadsafsaf"
    50f2: 234 // value comment
    51fa: [2342134, 2342135, 2342136]
    52// Mix of list and single elements.
    53fb: [-2342134, -2342135, -2342136, -1000]
    54fc: [4, 7, -12, 4, 7, -3, 4, 7, 0]
    55pairs: [{
    56	key:   "sdfff"
    57	value: "q\"qq\\q\n"
    58}, {
    59	key:   "   sdfff2  тест "
    60	value: "q\tqq<>q2&\u0001�"
    61}]
    62bbbb: '\x00\x01\x02\xff\xfe\xfd'

View as plain text