diff options
author | Thomas White <taw@bitwiz.org.uk> | 2013-09-07 02:04:23 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2013-09-07 02:04:23 +0200 |
commit | 8474b3208a8b72d47bce670ed46d356ca39ae4bc (patch) | |
tree | c53d481b6811dcbe1ba23b54c692e6c2c42d980f /tests | |
parent | 574aa3cc144122ca89a54c71463ae9323a3e70a6 (diff) |
Fix handling of SC blocks at end of text
Diffstat (limited to 'tests')
-rw-r--r-- | tests/storycode_test.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/storycode_test.c b/tests/storycode_test.c index 5fbde5a..c927777 100644 --- a/tests/storycode_test.c +++ b/tests/storycode_test.c @@ -30,13 +30,11 @@ #include "../src/storycode.h" -int main(int argc, char *argv[]) +static int test_sc(const char *tt) { SCBlockList *bl; SCBlockListIterator *iter; struct scblock *b; - const char *tt = "\\bg[a=b]{wibble \\f{wobble}}\\bg{rwawr}\\muhu Wobble" - "\\wibble{}\\f{wibble \\bg[muhu]{wobble}}\\frib[\\f] f"; printf("'%s' ->\n", tt); bl = sc_find_blocks(tt, "bg"); @@ -72,3 +70,18 @@ int main(int argc, char *argv[]) return 0; } + +int main(int argc, char *argv[]) +{ + int v = 0; + int r; + + r = test_sc("\\bg[a=b]{wibble \\f{wobble}}\\bg{rwawr}\\muhu Wobble" + "\\wibble{}\\f{wibble \\bg[muhu]{wobble}}\\frib[\\f] f"); + if ( r ) v = 1; + + r = test_sc("A B C \\wibble"); + if ( r ) v = 1; + + return v; +} |