Skip to content

Commit

Permalink
Test failing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jun 2, 2014
1 parent 2465ee4 commit f2c8005
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/check_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,17 @@ START_TEST (test_incomplete_slug_path)
r3_tree_insert_path(n, "/post/{handle:\\d{3}}/{a}", NULL);

ret_node = r3_tree_insert_path(n, "/users/{idx:\\d{3}}/{idy}", NULL);
assert(ret_node);
ck_assert(ret_node);

// OK to insert, but should return error when compiling patterns
// FIXME: this one returns the inserted node object.
ret_node = r3_tree_insert_path(n, "/users/{idx:\\d{3}}/{idy:aaa}", NULL);
assert(ret_node);
node * ret_node2 = r3_tree_insert_path(n, "/users/{idx:\\d{3}}/{idy:aaa}", NULL);
ck_assert(ret_node2);
ck_assert(ret_node2 != ret_node); // make sure it's another node


char *errstr = NULL;
r3_tree_compile(n, &errstr);
ck_assert(errstr == NULL); // no error

r3_tree_dump(n, NULL);

Expand Down

0 comments on commit f2c8005

Please sign in to comment.