Module Name:    src
Committed By:   rillig
Date:           Tue Oct  5 18:21:03 UTC 2021

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

Log Message:
tests/indent: test indentation of nested declarations and statements


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/token-comment.0
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/indent/token-comment.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-comment.0
diff -u src/tests/usr.bin/indent/token-comment.0:1.3 src/tests/usr.bin/indent/token-comment.0:1.4
--- src/tests/usr.bin/indent/token-comment.0:1.3	Tue Oct  5 18:09:13 2021
+++ src/tests/usr.bin/indent/token-comment.0	Tue Oct  5 18:21:03 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-comment.0,v 1.3 2021/10/05 18:09:13 rillig Exp $ */
+/* $NetBSD: token-comment.0,v 1.4 2021/10/05 18:21:03 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -77,6 +77,19 @@ function(void)
 
 	int decl;	// C99 declaration comment
 
+	{
+		int decl;	/* indented declaration */
+		{
+			int decl;	/* indented declaration */
+			{
+				int decl;	/* indented declaration */
+				{
+					int decl;	/* indented declaration */
+				}
+			}
+		}
+	}
+
 	code();			/* code comment */
 
 	code();			/* short
@@ -91,6 +104,13 @@ function(void)
  * the allowed line width */
 
 	code();			// C99 code comment
+
+	if (cond) /* comment */
+		if (cond) /* comment */
+			if (cond) /* comment */
+				if (cond) /* comment */
+					if (cond) /* comment */
+						code(); /* comment */
 }
 
 /*INDENT OFF*/

Index: src/tests/usr.bin/indent/token-comment.0.stdout
diff -u src/tests/usr.bin/indent/token-comment.0.stdout:1.4 src/tests/usr.bin/indent/token-comment.0.stdout:1.5
--- src/tests/usr.bin/indent/token-comment.0.stdout:1.4	Tue Oct  5 18:09:13 2021
+++ src/tests/usr.bin/indent/token-comment.0.stdout	Tue Oct  5 18:21:03 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-comment.0.stdout,v 1.4 2021/10/05 18:09:13 rillig Exp $ */
+/* $NetBSD: token-comment.0.stdout,v 1.5 2021/10/05 18:21:03 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -77,6 +77,19 @@ function(void)
 
 	int decl;		// C99 declaration comment
 
+	{
+		int decl;	/* indented declaration */
+		{
+			int decl;	/* indented declaration */
+			{
+				int decl;	/* indented declaration */
+				{
+					int decl;	/* indented declaration */
+				}
+			}
+		}
+	}
+
 	code();			/* code comment */
 
 	code();			/* short multi-line code comment */
@@ -88,6 +101,13 @@ function(void)
 				 * than the allowed line width */
 
 	code();			// C99 code comment
+
+	if (cond)		/* comment */
+		if (cond)	/* comment */
+			if (cond)	/* comment */
+				if (cond)	/* comment */
+					if (cond)	/* comment */
+						code();	/* comment */
 }
 /* $ FIXME: Missing empty line. */
 /*INDENT OFF*/

Reply via email to