Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/gen You need double the number of backslashes...



details:   https://anonhg.NetBSD.org/src/rev/752407d02f71
branches:  trunk
changeset: 332969:752407d02f71
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Oct 12 22:33:41 2014 +0000

description:
You need double the number of backslashes in a pattern, since \\ -> '\' in
the string which means escape. Now the tests don't fail.

diffstat:

 tests/lib/libc/gen/t_fnmatch.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r bb9ed5375a7d -r 752407d02f71 tests/lib/libc/gen/t_fnmatch.c
--- a/tests/lib/libc/gen/t_fnmatch.c    Sun Oct 12 22:32:33 2014 +0000
+++ b/tests/lib/libc/gen/t_fnmatch.c    Sun Oct 12 22:33:41 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fnmatch.c,v 1.5 2014/10/12 19:08:08 justin Exp $ */
+/* $NetBSD: t_fnmatch.c,v 1.6 2014/10/12 22:33:41 christos Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_fnmatch.c,v 1.5 2014/10/12 19:08:08 justin Exp $");
+__RCSID("$NetBSD: t_fnmatch.c,v 1.6 2014/10/12 22:33:41 christos Exp $");
 
 #include <atf-c.h>
 #include <fnmatch.h>
@@ -161,8 +161,8 @@
 
 ATF_TC_BODY(fnmatch_initialbracket, tc)
 {
-       ATF_CHECK(fnmatch("[[?*\\]", "\\", 0) == 0);
-       ATF_CHECK(fnmatch("[]?*\\]", "]", 0) == 0);
+       ATF_CHECK(fnmatch("[[?*\\\\]", "\\", 0) == 0);
+       ATF_CHECK(fnmatch("[]?*\\\\]", "]", 0) == 0);
        ATF_CHECK(fnmatch("[!]a-]", "b", 0) == 0);
        ATF_CHECK(fnmatch("[]-_]", "^", 0) == 0); /* range: ']', '^', '_' */
        ATF_CHECK(fnmatch("[!]-_]", "X", 0) == 0);
@@ -175,8 +175,6 @@
 
        ATF_CHECK(fnmatch("[*]/b", "a/b", 0) != 0);
        ATF_CHECK(fnmatch("[?]/b", "a/b", 0) != 0);
-
-       atf_tc_expect_fail("PR lib/49278");
 }
 
 ATF_TP_ADD_TCS(tp)



Home | Main Index | Thread Index | Old Index