Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/indent tests/indent: demonstrate wrong removed...



details:   https://anonhg.NetBSD.org/src/rev/2dcc09ad3d3a
branches:  trunk
changeset: 953436:2dcc09ad3d3a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Mar 08 22:13:05 2021 +0000

description:
tests/indent: demonstrate wrong removed empty line before '//'

diffstat:

 distrib/sets/lists/tests/mi               |   5 ++++-
 tests/usr.bin/indent/Makefile             |   5 ++++-
 tests/usr.bin/indent/opt-bap+sob.0        |  20 ++++++++++++++++++++
 tests/usr.bin/indent/opt-bap+sob.0.pro    |   5 +++++
 tests/usr.bin/indent/opt-bap+sob.0.stdout |  20 ++++++++++++++++++++
 tests/usr.bin/indent/t_indent.sh          |   4 ++--
 6 files changed, 55 insertions(+), 4 deletions(-)

diffs (114 lines):

diff -r 63a5b3dbf120 -r 2dcc09ad3d3a distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Mon Mar 08 22:01:18 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Mon Mar 08 22:13:05 2021 +0000
@@ -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
diff -r 63a5b3dbf120 -r 2dcc09ad3d3a tests/usr.bin/indent/Makefile
--- a/tests/usr.bin/indent/Makefile     Mon Mar 08 22:01:18 2021 +0000
+++ b/tests/usr.bin/indent/Makefile     Mon Mar 08 22:13:05 2021 +0000
@@ -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-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
diff -r 63a5b3dbf120 -r 2dcc09ad3d3a tests/usr.bin/indent/opt-bap+sob.0
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/indent/opt-bap+sob.0        Mon Mar 08 22:13:05 2021 +0000
@@ -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)
+{
+}
diff -r 63a5b3dbf120 -r 2dcc09ad3d3a tests/usr.bin/indent/opt-bap+sob.0.pro
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/indent/opt-bap+sob.0.pro    Mon Mar 08 22:13:05 2021 +0000
@@ -0,0 +1,5 @@
+/* $NetBSD: opt-bap+sob.0.pro,v 1.1 2021/03/08 22:13:05 rillig Exp $ */
+/* $FreeBSD$ */
+
+-bap
+-sob
diff -r 63a5b3dbf120 -r 2dcc09ad3d3a tests/usr.bin/indent/opt-bap+sob.0.stdout
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/indent/opt-bap+sob.0.stdout Mon Mar 08 22:13:05 2021 +0000
@@ -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)
+{
+}
diff -r 63a5b3dbf120 -r 2dcc09ad3d3a tests/usr.bin/indent/t_indent.sh
--- a/tests/usr.bin/indent/t_indent.sh  Mon Mar 08 22:01:18 2021 +0000
+++ b/tests/usr.bin/indent/t_indent.sh  Mon Mar 08 22:13:05 2021 +0000
@@ -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 @@
 
        case "${tc%.*}" in
        *-*)
-               local IFS="-"
+               local IFS="-+"
                for word in ${tc%.*}; do
                        tc_escaped="${tc_escaped:+${tc_escaped}_}${word}"
                done



Home | Main Index | Thread Index | Old Index