Module Name:    src
Committed By:   rillig
Date:           Mon Mar  8 22:13:05 UTC 2021

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/tests/usr.bin/indent: Makefile t_indent.sh
Added Files:
        src/tests/usr.bin/indent: opt-bap+sob.0 opt-bap+sob.0.pro
            opt-bap+sob.0.stdout

Log Message:
tests/indent: demonstrate wrong removed empty line before '//'


To generate a diff of this commit:
cvs rdiff -u -r1.1028 -r1.1029 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/opt-bap+sob.0 \
    src/tests/usr.bin/indent/opt-bap+sob.0.pro \
    src/tests/usr.bin/indent/opt-bap+sob.0.stdout
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/t_indent.sh

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.1028 src/distrib/sets/lists/tests/mi:1.1029
--- src/distrib/sets/lists/tests/mi:1.1028	Mon Mar  8 20:55:34 2021
+++ src/distrib/sets/lists/tests/mi	Mon Mar  8 22:13:05 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1028 2021/03/08 20:55:34 rillig Exp $
+# $NetBSD: mi,v 1.1029 2021/03/08 22:13:05 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4762,6 +4762,9 @@
 ./usr/tests/usr.bin/indent/opt-badp.0			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/opt-badp.0.pro		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/opt-badp.0.stdout		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/opt-bap+sob.0		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/opt-bap+sob.0.pro		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/opt-bap+sob.0.stdout		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/opt-bap.0			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/opt-bap.0.pro		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/opt-bap.0.stdout		tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/indent/Makefile
diff -u src/tests/usr.bin/indent/Makefile:1.5 src/tests/usr.bin/indent/Makefile:1.6
--- src/tests/usr.bin/indent/Makefile:1.5	Mon Mar  8 20:55:34 2021
+++ src/tests/usr.bin/indent/Makefile	Mon Mar  8 22:13:05 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2021/03/08 20:55:34 rillig Exp $
+#	$NetBSD: Makefile,v 1.6 2021/03/08 22:13:05 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -59,6 +59,9 @@ FILES+=		opt-bad.0.stdout
 FILES+=		opt-badp.0
 FILES+=		opt-badp.0.pro
 FILES+=		opt-badp.0.stdout
+FILES+=		opt-bap+sob.0
+FILES+=		opt-bap+sob.0.pro
+FILES+=		opt-bap+sob.0.stdout
 FILES+=		opt-bap.0
 FILES+=		opt-bap.0.pro
 FILES+=		opt-bap.0.stdout

Index: src/tests/usr.bin/indent/t_indent.sh
diff -u src/tests/usr.bin/indent/t_indent.sh:1.3 src/tests/usr.bin/indent/t_indent.sh:1.4
--- src/tests/usr.bin/indent/t_indent.sh:1.3	Mon Mar  8 20:01:16 2021
+++ src/tests/usr.bin/indent/t_indent.sh	Mon Mar  8 22:13:05 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_indent.sh,v 1.3 2021/03/08 20:01:16 rillig Exp $
+# $NetBSD: t_indent.sh,v 1.4 2021/03/08 22:13:05 rillig Exp $
 #
 # Copyright 2016 Dell EMC
 # All rights reserved.
@@ -79,7 +79,7 @@ add_testcase()
 
 	case "${tc%.*}" in
 	*-*)
-		local IFS="-"
+		local IFS="-+"
 		for word in ${tc%.*}; do
 			tc_escaped="${tc_escaped:+${tc_escaped}_}${word}"
 		done

Added files:

Index: src/tests/usr.bin/indent/opt-bap+sob.0
diff -u /dev/null src/tests/usr.bin/indent/opt-bap+sob.0:1.1
--- /dev/null	Mon Mar  8 22:13:06 2021
+++ src/tests/usr.bin/indent/opt-bap+sob.0	Mon Mar  8 22:13:05 2021
@@ -0,0 +1,20 @@
+/* $NetBSD: opt-bap+sob.0,v 1.1 2021/03/08 22:13:05 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.
+ */
+
+void
+function1(void)
+{
+}
+
+///// separator /////
+
+void
+function2(void)
+{
+}
Index: src/tests/usr.bin/indent/opt-bap+sob.0.pro
diff -u /dev/null src/tests/usr.bin/indent/opt-bap+sob.0.pro:1.1
--- /dev/null	Mon Mar  8 22:13:06 2021
+++ src/tests/usr.bin/indent/opt-bap+sob.0.pro	Mon Mar  8 22:13:05 2021
@@ -0,0 +1,5 @@
+/* $NetBSD: opt-bap+sob.0.pro,v 1.1 2021/03/08 22:13:05 rillig Exp $ */
+/* $FreeBSD$ */
+
+-bap
+-sob
Index: src/tests/usr.bin/indent/opt-bap+sob.0.stdout
diff -u /dev/null src/tests/usr.bin/indent/opt-bap+sob.0.stdout:1.1
--- /dev/null	Mon Mar  8 22:13:06 2021
+++ src/tests/usr.bin/indent/opt-bap+sob.0.stdout	Mon Mar  8 22:13:05 2021
@@ -0,0 +1,20 @@
+/* $NetBSD: opt-bap+sob.0.stdout,v 1.1 2021/03/08 22:13:05 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.
+ */
+
+void
+function1(void)
+{
+}
+/* $ FIXME: Keep the empty line between the '}' and the '//'. */
+///// separator /////
+
+void
+function2(void)
+{
+}

Reply via email to