aboutsummaryrefslogtreecommitdiff
path: root/tests/storycode_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/storycode_test.c')
-rw-r--r--tests/storycode_test.c19
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;
+}