From 7269c12bbe4532f5f5844aaec16cf1bb75a1c71c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 15 Apr 2021 17:52:44 -0400 Subject: Expand URIs in reader This expands relative and prefixed URIs in the reader on the stack, rather than passing them to the caller to be dealt with. This pushes these context-full forms to the edge of the system as much as possible to minimise the headaches they can cause. Towards having stricter guarantees about nodes and eliminating the CURIE node type altogether. --- test/test_overflow.c | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) (limited to 'test/test_overflow.c') diff --git a/test/test_overflow.c b/test/test_overflow.c index 7f08112d..02b71008 100644 --- a/test/test_overflow.c +++ b/test/test_overflow.c @@ -21,7 +21,7 @@ #include #include -static const size_t min_stack_size = 4 * sizeof(size_t) + 256u; +static const size_t min_stack_size = 4 * sizeof(size_t) + 230u; static const size_t max_stack_size = 1024u; static SerdStatus @@ -90,11 +90,9 @@ static void test_turtle_overflow(void) { static const char* const test_strings[] = { - " :%99 .", " .", " " " .", - " eg:foo .", " 1234 .", " (1 2 3 4) .", " (((((((42))))))) .", @@ -112,7 +110,41 @@ test_turtle_overflow(void) "@prefix ug.dot: . \nug.dot:s ug.dot:p ug.dot:o .\n", // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) - "@prefix øøøøøøøøø: . \n" + " " + " " + " .", + + // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) + " " + "\"typed\"^^ .", + + // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) + "@prefix eg: .\n" + " " + "\"typed\"^^eg:Datatype .", + + // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) + "@prefix eg: .\n" + " eg:foo .", + + // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) + "@prefix prefix: .\n" + "prefix:subject prefix:predicate prefix:object .\n", + + // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) + "@prefix eg: .\n" + "eg:s eg:p [ eg:p [ eg:p [ eg:p [ eg:p []]]]] .\n", + + // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) + "@prefix eg: .\n" + "eg:s eg:p ( 1 2 3 ( 4 5 6 ( 7 8 9 ) ) ) .\n", + + // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) + "@prefix eg: .\n" + " eg:%99 .", + + // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) + "@prefix øøøøøøøøø: .\n" " øøøøøøøøø:p " "øøøøøøøøø:o .\n", @@ -140,8 +172,8 @@ test_turtle_overflow(void) // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) "@prefix prefix: .\n" - "prefix:subjectthatwillcomearoundtobeingfinishedanycharacternow " - "prefix:predicate prefix:object .\n", + " " + "prefix:predicate prefix:object ; prefix:p prefix:o .\n", // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) "@prefix eg: .\n" -- cgit v1.2.1