Revert "usbd - Do not start moused by default when a usb mouse is connected"
[dragonfly.git] / contrib / sendmail-8.14 / libsm / t-match.c
blobd2776c02a2b1df64a396d04938a27ab6e77f476b
1 /*
2 * Copyright (c) 2000 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
8 */
10 #include <sm/gen.h>
11 SM_IDSTR(id, "@(#)$Id: t-match.c,v 1.9 2001/09/11 04:04:49 gshapiro Exp $")
13 #include <sm/string.h>
14 #include <sm/io.h>
15 #include <sm/test.h>
17 #define try(str, pat, want) \
18 got = sm_match(str, pat); \
19 if (!SM_TEST(got == want)) \
20 (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, \
21 "sm_match(\"%s\", \"%s\") returns %s\n", \
22 str, pat, got ? "true" : "false");
24 int
25 main(argc, argv)
26 int argc;
27 char **argv;
29 bool got;
31 sm_test_begin(argc, argv, "test sm_match");
33 try("foo", "foo", true);
34 try("foo", "bar", false);
35 try("foo[bar", "foo[bar", true);
36 try("foo[bar]", "foo[bar]", false);
37 try("foob", "foo[bar]", true);
38 try("a-b", "a[]-]b", true);
39 try("abcde", "a*e", true);
40 try("[", "[[]", true);
41 try("c", "[a-z]", true);
42 try("C", "[a-z]", false);
43 try("F:sm.heap", "[!F]*", false);
44 try("E:sm.err", "[!F]*", true);
46 return sm_test_end();