Module Name:    src
Committed By:   rillig
Date:           Tue Sep 28 06:57:48 UTC 2021

Modified Files:
        src/tests/usr.bin/indent: token-lparen.0 token-lparen.0.pro
            token-lparen.0.stdout

Log Message:
tests/indent: demonstrate missing space before designated initializer

Seen in usr.bin/indent/lexi.c, num_lex_row.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/token-lparen.0 \
    src/tests/usr.bin/indent/token-lparen.0.pro \
    src/tests/usr.bin/indent/token-lparen.0.stdout

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

Modified files:

Index: src/tests/usr.bin/indent/token-lparen.0
diff -u src/tests/usr.bin/indent/token-lparen.0:1.1 src/tests/usr.bin/indent/token-lparen.0:1.2
--- src/tests/usr.bin/indent/token-lparen.0:1.1	Fri Mar 12 00:13:06 2021
+++ src/tests/usr.bin/indent/token-lparen.0	Tue Sep 28 06:57:48 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-lparen.0,v 1.1 2021/03/12 00:13:06 rillig Exp $ */
+/* $NetBSD: token-lparen.0,v 1.2 2021/09/28 06:57:48 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -15,4 +15,20 @@
  * In a type declaration, it marks the beginning of the function parameters.
  */
 
-/* TODO: Add some code to be formatted. */
+/* This is the maximum supported number of parentheses. */
+int zero = (((((((((((((((((((0)))))))))))))))))));
+
+void (*action)(void);
+
+#define macro(arg) ((arg) + 1)
+
+void
+function(void)
+{
+    other_function();
+    other_function("first", 2, "last argument"[4]);
+}
+
+int array[] = {
+	1, 2, [2] = 3, [3] = 4,
+};
Index: src/tests/usr.bin/indent/token-lparen.0.pro
diff -u src/tests/usr.bin/indent/token-lparen.0.pro:1.1 src/tests/usr.bin/indent/token-lparen.0.pro:1.2
--- src/tests/usr.bin/indent/token-lparen.0.pro:1.1	Fri Mar 12 00:13:06 2021
+++ src/tests/usr.bin/indent/token-lparen.0.pro	Tue Sep 28 06:57:48 2021
@@ -1,8 +1,4 @@
-/* $NetBSD: token-lparen.0.pro,v 1.1 2021/03/12 00:13:06 rillig Exp $ */
+/* $NetBSD: token-lparen.0.pro,v 1.2 2021/09/28 06:57:48 rillig Exp $ */
 /* $FreeBSD$ */
 
-/*
- * TODO: Explain the command line options of the test.
- */
-
-/* TODO: Add some command line options */
+-di0
Index: src/tests/usr.bin/indent/token-lparen.0.stdout
diff -u src/tests/usr.bin/indent/token-lparen.0.stdout:1.1 src/tests/usr.bin/indent/token-lparen.0.stdout:1.2
--- src/tests/usr.bin/indent/token-lparen.0.stdout:1.1	Fri Mar 12 00:13:06 2021
+++ src/tests/usr.bin/indent/token-lparen.0.stdout	Tue Sep 28 06:57:48 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-lparen.0.stdout,v 1.1 2021/03/12 00:13:06 rillig Exp $ */
+/* $NetBSD: token-lparen.0.stdout,v 1.2 2021/09/28 06:57:48 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -15,4 +15,22 @@
  * In a type declaration, it marks the beginning of the function parameters.
  */
 
-/* TODO: Add some code to be formatted. */
+/* This is the maximum supported number of parentheses. */
+int zero = (((((((((((((((((((0)))))))))))))))))));
+
+/* $ XXX: The space between the parentheses is unusual. */
+void (*action) (void);
+
+#define macro(arg) ((arg) + 1)
+
+void
+function(void)
+{
+	other_function();
+	other_function("first", 2, "last argument"[4]);
+}
+
+int array[] = {
+/* $ FIXME: Add space after comma */
+	1, 2,[2] = 3,[3] = 4,
+};

Reply via email to