aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-01-10 23:05:10 +0100
committerThomas White <taw@bitwiz.org.uk>2014-01-10 23:05:10 +0100
commitd66704db5091ec97d57a6939ecef8f33fb1aac76 (patch)
tree1dab3338005b3ce9c7c31b9753be4bbcedea97d3 /tests
parent11c9df92e61dc2aa1d76d48080e0975882e97336 (diff)
The parser
Diffstat (limited to 'tests')
-rw-r--r--tests/storycode_test.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/tests/storycode_test.c b/tests/storycode_test.c
index 524fe19..7d73c41 100644
--- a/tests/storycode_test.c
+++ b/tests/storycode_test.c
@@ -32,41 +32,19 @@
static int test_sc(const char *tt)
{
- SCBlockList *bl;
- SCBlockListIterator *iter;
- struct scblock *b;
+ SCBlock *bl;
printf("'%s' ->\n", tt);
- bl = sc_find_blocks(tt, "bg");
+ bl = sc_parse(tt);
if ( bl == NULL ) {
- printf("Failed to find blocks.\n");
+ printf("Failed to parse SC\n");
return 1;
}
- for ( b = sc_block_list_first(bl, &iter);
- b != NULL;
- b = sc_block_list_next(bl, iter) )
- {
- printf(" \\%s [%s] {%s}\n", b->name, b->options, b->contents);
- }
- sc_block_list_free(bl);
-
- printf("->\n");
- bl = sc_find_blocks(tt, NULL);
+ show_sc_blocks(bl);
- if ( bl == NULL ) {
- printf("Failed to find blocks.\n");
- return 1;
- }
-
- for ( b = sc_block_list_first(bl, &iter);
- b != NULL;
- b = sc_block_list_next(bl, iter) )
- {
- printf(" \\%s [%s] {%s}\n", b->name, b->options, b->contents);
- }
- sc_block_list_free(bl);
+ sc_block_free(bl);
return 0;
}