Module Name: src
Committed By: rillig
Date: Tue Oct 12 18:54:56 UTC 2021
Modified Files:
src/tests/usr.bin/indent: token-comment.0 token-comment.0.stdout
Log Message:
tests/indent: test long code comments
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/token-comment.0
cvs rdiff -u -r1.9 -r1.10 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.7 src/tests/usr.bin/indent/token-comment.0:1.8
--- src/tests/usr.bin/indent/token-comment.0:1.7 Fri Oct 8 23:53:37 2021
+++ src/tests/usr.bin/indent/token-comment.0 Tue Oct 12 18:54:56 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-comment.0,v 1.7 2021/10/08 23:53:37 rillig Exp $ */
+/* $NetBSD: token-comment.0,v 1.8 2021/10/12 18:54:56 rillig Exp $ */
/* $FreeBSD$ */
/*
@@ -91,6 +91,11 @@ function(void)
}
code(); /* code comment */
+ code(); /* code comment _________ to line length 78 */
+ code(); /* code comment __________ to line length 79 */
+ code(); /* code comment ___________ to line length 80 */
+ code(); /* code comment ____________ to line length 81 */
+ code(); /* code comment _____________ to line length 82 */
code(); /* short
* multi-line
@@ -104,6 +109,11 @@ function(void)
* the allowed line width */
code(); // C99 code comment
+ code(); // C99 code comment ________ to line length 78
+ code(); // C99 code comment _________ to line length 79
+ code(); // C99 code comment __________ to line length 80
+ code(); // C99 code comment ___________ to line length 81
+ code(); // C99 code comment ____________ to line length 82
if (cond) /* comment */
if (cond) /* comment */
Index: src/tests/usr.bin/indent/token-comment.0.stdout
diff -u src/tests/usr.bin/indent/token-comment.0.stdout:1.9 src/tests/usr.bin/indent/token-comment.0.stdout:1.10
--- src/tests/usr.bin/indent/token-comment.0.stdout:1.9 Tue Oct 12 18:22:01 2021
+++ src/tests/usr.bin/indent/token-comment.0.stdout Tue Oct 12 18:54:56 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-comment.0.stdout,v 1.9 2021/10/12 18:22:01 rillig Exp $ */
+/* $NetBSD: token-comment.0.stdout,v 1.10 2021/10/12 18:54:56 rillig Exp $ */
/* $FreeBSD$ */
/*
@@ -95,6 +95,12 @@ function(void)
}
code(); /* code comment */
+ code(); /* code comment _________ to line length 78 */
+ code(); /* code comment __________ to line length 79 */
+ code(); /* code comment ___________ to line length 80 */
+ code(); /* code comment ____________ to line length 81 */
+ code(); /* code comment _____________ to line length
+ * 82 */
code(); /* short multi-line code comment */
@@ -104,7 +110,15 @@ function(void)
code(); /* long multi-line code comment that is longer
* than the allowed line width */
+/* $ Trailing C99 comments are not wrapped, as indent would not correctly */
+/* $ recognize the continuation lines as continued comments. For block */
+/* $ comments this works since the comment has not ended yet. */
code(); // C99 code comment
+ code(); // C99 code comment ________ to line length 78
+ code(); // C99 code comment _________ to line length 79
+ code(); // C99 code comment __________ to line length 80
+ code(); // C99 code comment ___________ to line length 81
+ code(); // C99 code comment ____________ to line length 82
if (cond) /* comment */
if (cond) /* comment */