]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/str/test/run-strreg.c
tal: save and restore errno across all notifiers.
[ccan] / ccan / tal / str / test / run-strreg.c
index 6d126f3970a13acdbed21cbb63e0115e1aa9d477..93b8602a3c1f8ab067c4406ece439db949ae6b5b 100644 (file)
@@ -14,14 +14,14 @@ static bool find_parent(tal_t *child, tal_t *parent)
        return false;
 }
 
-int main(int argc, char *argv[])
+int main(void)
 {
        void *ctx = tal_strdup(NULL, "toplevel");
        char *a, *b;
        /* If it accesses this, it will crash. */
        char **invalid = (char **)1L;
 
-       plan_tests(40);
+       plan_tests(41);
        /* Simple matching. */
        ok1(tal_strreg(ctx, "hello world!", "hello") == true);
        ok1(tal_strreg(ctx, "hello world!", "hi") == false);
@@ -116,5 +116,9 @@ int main(int argc, char *argv[])
        ok1(no_children(ctx));
        tal_free(ctx);
 
+       /* Don't get fooled by \(! */
+       ok1(tal_strreg(ctx, "(hello) (world)!", "\\([a-z]*\\) \\([a-z]+\\)",
+                      invalid) == true);
+
        return exit_status();
 }