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: test long code comments



details:   https://anonhg.NetBSD.org/src/rev/7ff55d66c01c
branches:  trunk
changeset: 989138:7ff55d66c01c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Oct 12 18:54:56 2021 +0000

description:
tests/indent: test long code comments

diffstat:

 tests/usr.bin/indent/token-comment.0        |  12 +++++++++++-
 tests/usr.bin/indent/token-comment.0.stdout |  16 +++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)

diffs (71 lines):

diff -r 552089e48699 -r 7ff55d66c01c tests/usr.bin/indent/token-comment.0
--- a/tests/usr.bin/indent/token-comment.0      Tue Oct 12 18:40:01 2021 +0000
+++ b/tests/usr.bin/indent/token-comment.0      Tue Oct 12 18:54:56 2021 +0000
@@ -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 @@
        }
 
        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 @@
  * 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 */
diff -r 552089e48699 -r 7ff55d66c01c tests/usr.bin/indent/token-comment.0.stdout
--- a/tests/usr.bin/indent/token-comment.0.stdout       Tue Oct 12 18:40:01 2021 +0000
+++ b/tests/usr.bin/indent/token-comment.0.stdout       Tue Oct 12 18:54:56 2021 +0000
@@ -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 @@
        }
 
        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 @@
        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 */



Home | Main Index | Thread Index | Old Index