Module Name: src Committed By: rillig Date: Fri Sep 24 17:37:55 UTC 2021
Modified Files: src/tests/usr.bin/indent: comments.0 comments.0.stdout opt-fc1.0 opt-fc1.0.stdout opt-nfc1.0 opt-nfc1.0.stdout Log Message: tests/indent: demonstrate inconsistent formatting of comments To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/comments.0 \ src/tests/usr.bin/indent/comments.0.stdout \ src/tests/usr.bin/indent/opt-fc1.0 \ src/tests/usr.bin/indent/opt-fc1.0.stdout \ src/tests/usr.bin/indent/opt-nfc1.0 \ src/tests/usr.bin/indent/opt-nfc1.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/comments.0 diff -u src/tests/usr.bin/indent/comments.0:1.2 src/tests/usr.bin/indent/comments.0:1.3 --- src/tests/usr.bin/indent/comments.0:1.2 Sun Mar 14 01:34:13 2021 +++ src/tests/usr.bin/indent/comments.0 Fri Sep 24 17:37:55 2021 @@ -1,5 +1,6 @@ -/* $NetBSD: comments.0,v 1.2 2021/03/14 01:34:13 rillig Exp $ */ +/* $NetBSD: comments.0,v 1.3 2021/09/24 17:37:55 rillig Exp $ */ /* $FreeBSD: head/usr.bin/indent/tests/comments.0 321383 2017-07-23 15:07:52Z pstef $ */ + typedef enum x { aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */ bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */ @@ -14,22 +15,22 @@ void t(void) { * * https://www.freebsd.org/cgi/man.cgi?query=indent&apropos=0&sektion=0&manpath=FreeBSD+12-current&arch=default&format=html */ - + /* * The default maximum line length for comments is 78, and the 'kk' at * the end makes the line exactly 78 bytes long. * * aaaaaa bbbbbb cccccc dddddd eeeeee ffffff ggggg hhhhh iiiii jjjj kk */ - + /* * Old indent unnecessarily removed the star comment continuation on the next line. - * + * * *test* */ - + /* r309219 Go through linked list, freeing from the malloced (t[-1]) address. */ - + /* r309343 */ } Index: src/tests/usr.bin/indent/comments.0.stdout diff -u src/tests/usr.bin/indent/comments.0.stdout:1.2 src/tests/usr.bin/indent/comments.0.stdout:1.3 --- src/tests/usr.bin/indent/comments.0.stdout:1.2 Sun Mar 14 01:34:13 2021 +++ src/tests/usr.bin/indent/comments.0.stdout Fri Sep 24 17:37:55 2021 @@ -1,5 +1,6 @@ -/* $NetBSD: comments.0.stdout,v 1.2 2021/03/14 01:34:13 rillig Exp $ */ +/* $NetBSD: comments.0.stdout,v 1.3 2021/09/24 17:37:55 rillig Exp $ */ /* $FreeBSD: head/usr.bin/indent/tests/comments.0.stdout 334563 2018-06-03 15:28:55Z pstef $ */ + typedef enum x { aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */ bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */ Index: src/tests/usr.bin/indent/opt-fc1.0 diff -u src/tests/usr.bin/indent/opt-fc1.0:1.2 src/tests/usr.bin/indent/opt-fc1.0:1.3 --- src/tests/usr.bin/indent/opt-fc1.0:1.2 Sat Mar 6 21:27:39 2021 +++ src/tests/usr.bin/indent/opt-fc1.0 Fri Sep 24 17:37:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt-fc1.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ +/* $NetBSD: opt-fc1.0,v 1.3 2021/09/24 17:37:55 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -8,3 +8,18 @@ * * */ + +/* $ Neither indentation nor surrounding spaces. */ +/*narrow*/ + +/* $ Indented by a single space, single spaces around the text. */ + /* space */ + +/* $ Indented by a single tab, single tabs around the text. */ + /* tab */ + +/* $ The space between these comments gets removed. */ +/* block1 */ /* block2 */ + +/* $ Both comment texts get surrounded by spaces. */ +/*block1*//*block2*/ Index: src/tests/usr.bin/indent/opt-fc1.0.stdout diff -u src/tests/usr.bin/indent/opt-fc1.0.stdout:1.2 src/tests/usr.bin/indent/opt-fc1.0.stdout:1.3 --- src/tests/usr.bin/indent/opt-fc1.0.stdout:1.2 Sat Mar 6 21:27:39 2021 +++ src/tests/usr.bin/indent/opt-fc1.0.stdout Fri Sep 24 17:37:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt-fc1.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ +/* $NetBSD: opt-fc1.0.stdout,v 1.3 2021/09/24 17:37:55 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -7,3 +7,18 @@ * * */ + +/* $ The comment text got surrounded by spaces. */ +/* narrow */ + +/* $ The indentation got removed. */ +/* space */ + +/* $ The indentation got removed, only the leading tab got replaced by a space. */ +/* tab */ + +/* $ The space between these comments got removed. */ +/* block1 *//* block2 */ + +/* $ Both comment texts got surrounded by spaces. */ +/* block1 *//* block2 */ Index: src/tests/usr.bin/indent/opt-nfc1.0 diff -u src/tests/usr.bin/indent/opt-nfc1.0:1.2 src/tests/usr.bin/indent/opt-nfc1.0:1.3 --- src/tests/usr.bin/indent/opt-nfc1.0:1.2 Sat Mar 6 21:27:39 2021 +++ src/tests/usr.bin/indent/opt-nfc1.0 Fri Sep 24 17:37:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt-nfc1.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ +/* $NetBSD: opt-nfc1.0,v 1.3 2021/09/24 17:37:55 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -8,3 +8,18 @@ * * */ + +/* $ Neither indentation nor surrounding spaces. */ +/*narrow*/ + +/* $ Indented by a single space, single spaces around the text. */ + /* space */ + +/* $ Indented by a single tab, single tabs around the text. */ + /* tab */ + +/* $ The space between these comments gets removed. */ +/* block1 */ /* block2 */ + +/* $ Both comment texts get surrounded by spaces. */ +/*block1*//*block2*/ Index: src/tests/usr.bin/indent/opt-nfc1.0.stdout diff -u src/tests/usr.bin/indent/opt-nfc1.0.stdout:1.2 src/tests/usr.bin/indent/opt-nfc1.0.stdout:1.3 --- src/tests/usr.bin/indent/opt-nfc1.0.stdout:1.2 Sat Mar 6 21:27:39 2021 +++ src/tests/usr.bin/indent/opt-nfc1.0.stdout Fri Sep 24 17:37:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt-nfc1.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ +/* $NetBSD: opt-nfc1.0.stdout,v 1.3 2021/09/24 17:37:55 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -8,3 +8,22 @@ * * */ + +/* $ No spaces got added around the comment text. */ +/*narrow*/ + +/* $ The indentation of a single space was preserved. */ +/* $ FIXME: The line must not start with a space. */ + /* space */ + +/* $ The indentation was changed from a single tab to a single space. */ +/* $ FIXME: The line must not start with a space. */ + /* tab */ + +/* $ FIXME: The line must not start with a space. */ + /* block1 *//* block2 */ + +/* $ FIXME: The line must not start with a space. */ +/* $ FIXME: It's inconsistent that the first comment gets no spaces. */ +/* $ FIXME: It's inconsistent that the second comment gets spaces. */ + /*block1*//* block2 */