Skip to content

Commit

Permalink
test: make sure the block types are correct
Browse files Browse the repository at this point in the history
  • Loading branch information
jb55 committed Dec 31, 2023
1 parent f7b1bc0 commit b4f2ff1
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions test.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,11 +834,25 @@ static void test_url_parsing() {
while ((block = ndb_blocks_iterate_next(iter))) {
str = ndb_block_str(block);
switch (++i) {
case 1: assert(!strncmp(str->str, DAMUSIO, str->len)); break;
case 2: assert(!strncmp(str->str, ", ", str->len)); break;
case 3: assert(!strncmp(str->str, JB55COM, str->len)); break;
case 4: assert(!strncmp(str->str, ", ", str->len)); break;
case 5: assert(!strncmp(str->str, WIKIORG, str->len)); break;
case 1:
assert(ndb_get_block_type(block) == BLOCK_URL);
assert(!strncmp(str->str, DAMUSIO, str->len));
break;
case 2:
assert(ndb_get_block_type(block) == BLOCK_TEXT);
assert(!strncmp(str->str, ", ", str->len));
break;
case 3:
assert(ndb_get_block_type(block) == BLOCK_URL);
assert(!strncmp(str->str, JB55COM, str->len));
break;
case 4:
assert(ndb_get_block_type(block) == BLOCK_TEXT);
assert(!strncmp(str->str, ", ", str->len));
break;
case 5:
assert(ndb_get_block_type(block) == BLOCK_URL);
assert(!strncmp(str->str, WIKIORG, str->len)); break;
}
}

Expand Down

0 comments on commit b4f2ff1

Please sign in to comment.