Sun Mar 14 01:34:13 2021 UTC ()
indent: fix off-by-one error in comment wrapping
The manual page says that the default maximum length of a comment line
is 78. The test 'comments.0' wrongly assumed that this 78 would refer
to the maximum _column_ allowed, which is off by one.
Fix the wording in the test 'comments.0' and remove the (now satisfied)
expectation comments in the test 'token-comment.0'.
Several other tests just happened to hit that limit, fix these as well.
(rillig)
diff -r1.1 -r1.2 src/tests/usr.bin/indent/comments.0
diff -r1.1 -r1.2 src/tests/usr.bin/indent/comments.0.stdout
diff -r1.1 -r1.2 src/tests/usr.bin/indent/opt-bap+sob.0.stdout
diff -r1.1 -r1.2 src/tests/usr.bin/indent/token-keyword_do_else.0.stdout
diff -r1.2 -r1.3 src/tests/usr.bin/indent/opt-P.0.stdout
diff -r1.2 -r1.3 src/tests/usr.bin/indent/token-comment.0.stdout
diff -r1.31 -r1.32 src/usr.bin/indent/pr_comment.c
--- src/tests/usr.bin/indent/Attic/comments.0 2019/04/04 15:27:35 1.1
+++ src/tests/usr.bin/indent/Attic/comments.0 2021/03/14 01:34:13 1.2
--- src/tests/usr.bin/indent/Attic/comments.0.stdout 2019/04/04 15:27:35 1.1
+++ src/tests/usr.bin/indent/Attic/comments.0.stdout 2021/03/14 01:34:13 1.2
--- src/tests/usr.bin/indent/Attic/opt-bap+sob.0.stdout 2021/03/08 22:13:05 1.1
+++ src/tests/usr.bin/indent/Attic/opt-bap+sob.0.stdout 2021/03/14 01:34:13 1.2
@@ -1,10 +1,10 @@
-/* $NetBSD: opt-bap+sob.0.stdout,v 1.1 2021/03/08 22:13:05 rillig Exp $ */
+/* $NetBSD: opt-bap+sob.0.stdout,v 1.2 2021/03/14 01:34:13 rillig Exp $ */
/* $FreeBSD$ */
/*
* As of 2021-03-08, the combination of -bap and -sob, which occurs in the
- * example indent.pro from NetBSD, removes the empty line above the
- * separator. Seen in games/cgram/cgram.c.
+ * example indent.pro from NetBSD, removes the empty line above the separator.
+ * Seen in games/cgram/cgram.c.
*/
void
--- src/tests/usr.bin/indent/Attic/token-keyword_do_else.0.stdout 2021/03/12 00:13:06 1.1
+++ src/tests/usr.bin/indent/Attic/token-keyword_do_else.0.stdout 2021/03/14 01:34:13 1.2
@@ -1,10 +1,10 @@
-/* $NetBSD: token-keyword_do_else.0.stdout,v 1.1 2021/03/12 00:13:06 rillig Exp $ */
+/* $NetBSD: token-keyword_do_else.0.stdout,v 1.2 2021/03/14 01:34:13 rillig Exp $ */
/* $FreeBSD$ */
/*
- * Tests for the keyword 'do' or 'else'. These two keywords are followed by
- * a space. In contrast to 'for', 'if' and 'while', the space is not
- * followed by a parenthesized expression.
+ * Tests for the keyword 'do' or 'else'. These two keywords are followed by a
+ * space. In contrast to 'for', 'if' and 'while', the space is not followed
+ * by a parenthesized expression.
*/
/* TODO: Add some code to be formatted. */
--- src/tests/usr.bin/indent/Attic/opt-P.0.stdout 2021/03/07 10:12:18 1.2
+++ src/tests/usr.bin/indent/Attic/opt-P.0.stdout 2021/03/14 01:34:13 1.3
@@ -1,8 +1,7 @@
-/* $NetBSD: opt-P.0.stdout,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
+/* $NetBSD: opt-P.0.stdout,v 1.3 2021/03/14 01:34:13 rillig Exp $ */
/* $FreeBSD$ */
/*
- * Mentioning another profile via -P has no effect since only a single
- * profile can be specified on the command line, and there is no 'include'
- * option.
+ * Mentioning another profile via -P has no effect since only a single profile
+ * can be specified on the command line, and there is no 'include' option.
*/
--- src/tests/usr.bin/indent/Attic/token-comment.0.stdout 2021/03/14 00:50:39 1.2
+++ src/tests/usr.bin/indent/Attic/token-comment.0.stdout 2021/03/14 01:34:13 1.3
--- src/usr.bin/indent/pr_comment.c 2021/03/14 00:22:16 1.31
+++ src/usr.bin/indent/pr_comment.c 2021/03/14 01:34:13 1.32