Module Name:    src
Committed By:   rillig
Date:           Sun Feb 21 21:26:26 UTC 2021

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/tests/usr.bin/indent: Makefile
Added Files:
        src/tests/usr.bin/indent: comment-line-end.0 comment-line-end.0.stdout

Log Message:
indent: add test demonstrating that indent cannot handle C99

indent cannot handle line-end comments.

The indent test suite requires each test file to have both a NetBSD and
a FreeBSD RCS ID.  If the FreeBSD RCS ID is missing, the test will
silently pass since in that case, an empty file is compared with an
empty file.  See the /start/,/end/ operator in t_indent.sh.


To generate a diff of this commit:
cvs rdiff -u -r1.1021 -r1.1022 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/comment-line-end.0 \
    src/tests/usr.bin/indent/comment-line-end.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/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1021 src/distrib/sets/lists/tests/mi:1.1022
--- src/distrib/sets/lists/tests/mi:1.1021	Sun Feb 21 08:05:51 2021
+++ src/distrib/sets/lists/tests/mi	Sun Feb 21 21:26:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1021 2021/02/21 08:05:51 rillig Exp $
+# $NetBSD: mi,v 1.1022 2021/02/21 21:26:26 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4708,6 +4708,8 @@
 ./usr/tests/usr.bin/indent/Kyuafile			tests-usr.bin-tests	compattestfile,atf,kyua
 ./usr/tests/usr.bin/indent/binary.0			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/binary.0.stdout		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/comment-line-end.0		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/comment-line-end.0.stdout	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/comments.0			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/comments.0.pro		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/comments.0.stdout		tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/indent/Makefile
diff -u src/tests/usr.bin/indent/Makefile:1.1 src/tests/usr.bin/indent/Makefile:1.2
--- src/tests/usr.bin/indent/Makefile:1.1	Thu Apr  4 15:27:35 2019
+++ src/tests/usr.bin/indent/Makefile	Sun Feb 21 21:26:26 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2019/04/04 15:27:35 kamil Exp $
+#	$NetBSD: Makefile,v 1.2 2021/02/21 21:26:26 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -8,6 +8,8 @@ TESTS_SH=	t_indent
 FILESDIR=	${TESTSDIR}
 FILES=		binary.0
 FILES+=		binary.0.stdout
+FILES+=		comment-line-end.0
+FILES+=		comment-line-end.0.stdout
 FILES+=		comments.0
 FILES+=		comments.0.pro
 FILES+=		comments.0.stdout

Added files:

Index: src/tests/usr.bin/indent/comment-line-end.0
diff -u /dev/null src/tests/usr.bin/indent/comment-line-end.0:1.1
--- /dev/null	Sun Feb 21 21:26:27 2021
+++ src/tests/usr.bin/indent/comment-line-end.0	Sun Feb 21 21:26:26 2021
@@ -0,0 +1,20 @@
+/* $NetBSD: comment-line-end.0,v 1.1 2021/02/21 21:26:26 rillig Exp $ */
+/* This $FreeBSD$ tag is required by the test suite, for no reason. */
+
+/*
+ * Demonstrates that line-end comments can affect the following lines.
+ *
+ * FIXME: The '{' of main must be in column 1, not directly after the ')'.
+ *
+ * FIXME: The 'Note: removing' below gets "indented" to 'Note:removing'.
+ *
+ * FIXME: The 'line-end' gets "indented" to 'line - end'.
+ */
+
+// Note: removing one of these line-end comments affects the formatting
+// of the main function below.
+
+int
+main(void)
+{
+}
Index: src/tests/usr.bin/indent/comment-line-end.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/comment-line-end.0.stdout:1.1
--- /dev/null	Sun Feb 21 21:26:27 2021
+++ src/tests/usr.bin/indent/comment-line-end.0.stdout	Sun Feb 21 21:26:26 2021
@@ -0,0 +1,19 @@
+/* $NetBSD: comment-line-end.0.stdout,v 1.1 2021/02/21 21:26:26 rillig Exp $ */
+/* This $FreeBSD$ tag is required by the test suite, for no reason. */
+
+/*
+ * Demonstrates that line-end comments can affect the following lines.
+ *
+ * FIXME: The '{' of main must be in column 1, not directly after the ')'.
+ *
+ * FIXME: The 'Note: removing' below gets "indented" to 'Note:removing'.
+ *
+ * FIXME: The 'line-end' gets "indented" to 'line - end'.
+ */
+
+// Note:removing one of these line - end comments affects the formatting
+// of the main function below.
+
+int
+main(void){
+}

Reply via email to