Module Name:    src
Committed By:   rillig
Date:           Mon Mar  8 20:55:34 UTC 2021

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/tests/usr.bin/indent: Makefile
Added Files:
        src/tests/usr.bin/indent: block.0 block.0.stdout

Log Message:
tests/indent: demonstrate another bug in nested blocks


To generate a diff of this commit:
cvs rdiff -u -r1.1027 -r1.1028 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/block.0 \
    src/tests/usr.bin/indent/block.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.1027 src/distrib/sets/lists/tests/mi:1.1028
--- src/distrib/sets/lists/tests/mi:1.1027	Mon Mar  8 20:12:04 2021
+++ src/distrib/sets/lists/tests/mi	Mon Mar  8 20:55:34 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1027 2021/03/08 20:12:04 rillig Exp $
+# $NetBSD: mi,v 1.1028 2021/03/08 20:55:34 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/block.0			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/block.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

Index: src/tests/usr.bin/indent/Makefile
diff -u src/tests/usr.bin/indent/Makefile:1.4 src/tests/usr.bin/indent/Makefile:1.5
--- src/tests/usr.bin/indent/Makefile:1.4	Mon Mar  8 20:12:04 2021
+++ src/tests/usr.bin/indent/Makefile	Mon Mar  8 20:55:34 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2021/03/08 20:12:04 rillig Exp $
+#	$NetBSD: Makefile,v 1.5 2021/03/08 20:55:34 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -8,6 +8,8 @@ TESTS_SH=	t_indent
 FILESDIR=	${TESTSDIR}
 FILES=		binary.0
 FILES+=		binary.0.stdout
+FILES+=		block.0
+FILES+=		block.0.stdout
 FILES+=		comment-line-end.0
 FILES+=		comment-line-end.0.stdout
 FILES+=		comments.0

Added files:

Index: src/tests/usr.bin/indent/block.0
diff -u /dev/null src/tests/usr.bin/indent/block.0:1.1
--- /dev/null	Mon Mar  8 20:55:34 2021
+++ src/tests/usr.bin/indent/block.0	Mon Mar  8 20:55:34 2021
@@ -0,0 +1,14 @@
+/* $NetBSD: block.0,v 1.1 2021/03/08 20:55:34 rillig Exp $ */
+/* $FreeBSD$ */
+
+void
+function(void)
+{
+	if (true) {
+
+	}
+
+	{
+		print("block");
+	}
+}
Index: src/tests/usr.bin/indent/block.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/block.0.stdout:1.1
--- /dev/null	Mon Mar  8 20:55:34 2021
+++ src/tests/usr.bin/indent/block.0.stdout	Mon Mar  8 20:55:34 2021
@@ -0,0 +1,15 @@
+/* $NetBSD: block.0.stdout,v 1.1 2021/03/08 20:55:34 rillig Exp $ */
+/* $FreeBSD$ */
+
+void
+function(void)
+{
+	if (true) {
+
+/* $ FIXME: indent must not merge these braces. */
+	} {
+/* $ FIXME: the following empty line was not in the input. */
+
+		print("block");
+	}
+}

Reply via email to