2019-12-08 14:31:14 +00:00
|
|
|
NAME=pFb.test simple protobuf
|
|
|
|
FILE=-
|
2020-04-05 12:56:06 +00:00
|
|
|
CMDS=<<EOF
|
|
|
|
wx 0a 2e 0a 07 56 69 6e 63 65 6e 74 10 09 1a 10 56 69 6e 63 65 6e 74 40 74 65 73 74 2e 63 6f 6d 22 0f 0a 0b 31 35 30 31 31 31 31 31 31 31 31 10 02
|
|
|
|
pFb
|
|
|
|
EOF
|
2019-12-08 14:31:14 +00:00
|
|
|
EXPECT=<<EOF
|
|
|
|
1 {
|
|
|
|
1: "Vincent"
|
|
|
|
2: 9 | 9
|
|
|
|
3: "Vincent@test.com"
|
|
|
|
4 {
|
|
|
|
1: "15011111111"
|
|
|
|
2: 2 | 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
RUN
|
|
|
|
|
|
|
|
NAME=pFb.test simple protobuf (verbose)
|
|
|
|
FILE=-
|
2020-04-05 12:56:06 +00:00
|
|
|
CMDS=<<EOF
|
|
|
|
wx 0a 2e 0a 07 56 69 6e 63 65 6e 74 10 09 1a 10 56 69 6e 63 65 6e 74 40 74 65 73 74 2e 63 6f 6d 22 0f 0a 0b 31 35 30 31 31 31 31 31 31 31 31 10 02
|
|
|
|
pFbv
|
|
|
|
EOF
|
2019-12-08 14:31:14 +00:00
|
|
|
EXPECT=<<EOF
|
|
|
|
1 [LEN_DELIM] {
|
|
|
|
1 [LEN_DELIM] : "Vincent"
|
|
|
|
2 [VARINT] : 9 | 9
|
|
|
|
3 [LEN_DELIM] : "Vincent@test.com"
|
|
|
|
4 [LEN_DELIM] {
|
|
|
|
1 [LEN_DELIM] : "15011111111"
|
|
|
|
2 [VARINT] : 2 | 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|
2022-09-21 21:02:56 +00:00
|
|
|
RUN
|
|
|
|
|
|
|
|
NAME=pFbj.test simple protobuf (json)
|
|
|
|
FILE=-
|
|
|
|
CMDS=<<EOF
|
|
|
|
wx 0a 2e 0a 07 56 69 6e 63 65 6e 74 10 09 1a 10 56 69 6e 63 65 6e 74 40 74 65 73 74 2e 63 6f 6d 22 0f 0a 0b 31 35 30 31 31 31 31 31 31 31 31 10 02
|
|
|
|
pFbj~{}
|
|
|
|
EOF
|
|
|
|
EXPECT=<<EOF
|
|
|
|
{
|
|
|
|
"type": "array",
|
|
|
|
"values": [
|
|
|
|
{
|
|
|
|
"type": "array",
|
|
|
|
"values": [
|
|
|
|
{
|
|
|
|
"type": "len-delim",
|
|
|
|
"value": "Vincent"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "varint",
|
|
|
|
"value": 9
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "len-delim",
|
|
|
|
"value": "Vincent@test.com"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "array",
|
|
|
|
"values": [
|
|
|
|
{
|
|
|
|
"type": "len-delim",
|
|
|
|
"value": "15011111111"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "varint",
|
|
|
|
"value": 2
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
RUN
|