summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2016-09-06 14:19:31 -0700
committerGitHub <noreply@github.com>2016-09-06 14:19:31 -0700
commitdd1b8dad6dfcd44cf6a9ed689d4e5d0c6f4addf7 (patch)
treed3ec1d67794275a55fa42a6d8ac1c3a9e1be69cd /tests
parentdfc409618f2d3684fd7f981461ac31d0b0a28989 (diff)
parentcf22c890c983378926b3e96ea81e7f4d840d57e9 (diff)
Merge pull request #67 from haberman/endstrhd
A few small fixes to the JSON parser.
Diffstat (limited to 'tests')
-rw-r--r--tests/pb/test_decoder.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/pb/test_decoder.cc b/tests/pb/test_decoder.cc
index 702366a..d272ea5 100644
--- a/tests/pb/test_decoder.cc
+++ b/tests/pb/test_decoder.cc
@@ -288,10 +288,11 @@ size_t value_string(int* depth, const uint32_t* num, const char* buf,
}
bool endstr(int* depth, const uint32_t* num) {
- UPB_UNUSED(depth);
UPB_UNUSED(num);
check_stack_alignment();
- output.append("\"\n");
+ output.append("\n");
+ indentbuf(&output, *depth);
+ appendf(&output, "%" PRIu32 ":\"\n", *num);
return true;
}
@@ -1096,10 +1097,12 @@ void test_valid() {
LINE("<")
LINE("%u:{")
LINE(" <")
- LINE(" %u:(5)\"abcde\"")
+ LINE(" %u:(5)\"abcde")
+ LINE(" %u:\"")
LINE(" >")
LINE("}")
- LINE(">"), msg_fn, UPB_DESCRIPTOR_TYPE_STRING);
+ LINE(">"), msg_fn, UPB_DESCRIPTOR_TYPE_STRING,
+ UPB_DESCRIPTOR_TYPE_STRING);
// Test implicit startseq/endseq.
uint32_t repfl_fn = rep_fn(UPB_DESCRIPTOR_TYPE_FLOAT);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback