Module Name:    src
Committed By:   rillig
Date:           Sat Apr 13 14:02:51 UTC 2024

Modified Files:
        src/tests/lib/libc/gen: t_fmtcheck.c

Log Message:
tests/fmtcheck: show that fmtcheck does not support "%2$s"


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/gen/t_fmtcheck.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/gen/t_fmtcheck.c
diff -u src/tests/lib/libc/gen/t_fmtcheck.c:1.5 src/tests/lib/libc/gen/t_fmtcheck.c:1.6
--- src/tests/lib/libc/gen/t_fmtcheck.c:1.5	Wed Dec 13 06:47:04 2017
+++ src/tests/lib/libc/gen/t_fmtcheck.c	Sat Apr 13 14:02:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_fmtcheck.c,v 1.5 2017/12/13 06:47:04 rin Exp $	*/
+/*	$NetBSD: t_fmtcheck.c,v 1.6 2024/04/13 14:02:51 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -75,6 +75,10 @@ struct test_fmt {
 	{ "%ld %30s %#llx %-10.*e", "This number %lu%% and string %s has %qd numbers and %.*g floats", 1 },
 	{ "%o", "%lx", 2 },
 	{ "%p", "%lu", 2 },
+	// When fmtcheck supports '$', it could be used in dcngettext.
+	{ "%1$s", "%s", 2 },
+	{ "%1$s %2$s", "%s %s", 2 },
+	{ "%2$d %1$s", "%s %d", 2 },
 };
 
 ATF_TC(fmtcheck_basic);

Reply via email to