Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/indent tests/indent: demonstrate missing space...



details:   https://anonhg.NetBSD.org/src/rev/093c83208ee7
branches:  trunk
changeset: 1023852:093c83208ee7
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Sep 28 06:57:48 2021 +0000

description:
tests/indent: demonstrate missing space before designated initializer

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

diffstat:

 tests/usr.bin/indent/token-lparen.0        |  20 ++++++++++++++++++--
 tests/usr.bin/indent/token-lparen.0.pro    |   8 ++------
 tests/usr.bin/indent/token-lparen.0.stdout |  22 ++++++++++++++++++++--
 3 files changed, 40 insertions(+), 10 deletions(-)

diffs (78 lines):

diff -r d9a9f8cb2ef2 -r 093c83208ee7 tests/usr.bin/indent/token-lparen.0
--- a/tests/usr.bin/indent/token-lparen.0       Tue Sep 28 06:45:08 2021 +0000
+++ b/tests/usr.bin/indent/token-lparen.0       Tue Sep 28 06:57:48 2021 +0000
@@ -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,
+};
diff -r d9a9f8cb2ef2 -r 093c83208ee7 tests/usr.bin/indent/token-lparen.0.pro
--- a/tests/usr.bin/indent/token-lparen.0.pro   Tue Sep 28 06:45:08 2021 +0000
+++ b/tests/usr.bin/indent/token-lparen.0.pro   Tue Sep 28 06:57:48 2021 +0000
@@ -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
diff -r d9a9f8cb2ef2 -r 093c83208ee7 tests/usr.bin/indent/token-lparen.0.stdout
--- a/tests/usr.bin/indent/token-lparen.0.stdout        Tue Sep 28 06:45:08 2021 +0000
+++ b/tests/usr.bin/indent/token-lparen.0.stdout        Tue Sep 28 06:57:48 2021 +0000
@@ -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,
+};



Home | Main Index | Thread Index | Old Index