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: add test for output line ...



details:   https://anonhg.NetBSD.org/src/rev/ff86672035bd
branches:  trunk
changeset: 953427:ff86672035bd
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Mar 08 20:12:04 2021 +0000

description:
tests/indent: add test for output line counting

diffstat:

 distrib/sets/lists/tests/mi          |   5 ++++-
 tests/usr.bin/indent/Makefile        |   5 ++++-
 tests/usr.bin/indent/lineno.0        |   9 +++++++++
 tests/usr.bin/indent/lineno.0.pro    |   4 ++++
 tests/usr.bin/indent/lineno.0.stdout |  14 ++++++++++++++
 5 files changed, 35 insertions(+), 2 deletions(-)

diffs (77 lines):

diff -r 245b110f802d -r ff86672035bd distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Mon Mar 08 20:02:47 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Mon Mar 08 20:12:04 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1026 2021/03/07 19:42:54 rillig Exp $
+# $NetBSD: mi,v 1.1027 2021/03/08 20:12:04 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4728,6 +4728,9 @@
 ./usr/tests/usr.bin/indent/label.0                     tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/label.0.pro                 tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/label.0.stdout              tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/lineno.0                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/lineno.0.pro                        tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/lineno.0.stdout             tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/list_head.0                 tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/list_head.0.stdout          tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/indent/ncs.0                       tests-usr.bin-tests     compattestfile,atf
diff -r 245b110f802d -r ff86672035bd tests/usr.bin/indent/Makefile
--- a/tests/usr.bin/indent/Makefile     Mon Mar 08 20:02:47 2021 +0000
+++ b/tests/usr.bin/indent/Makefile     Mon Mar 08 20:12:04 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.3 2021/03/06 17:56:33 rillig Exp $
+#      $NetBSD: Makefile,v 1.4 2021/03/08 20:12:04 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -25,6 +25,9 @@
 FILES+=                label.0
 FILES+=                label.0.stdout
 FILES+=                label.0.pro
+FILES+=                lineno.0
+FILES+=                lineno.0.pro
+FILES+=                lineno.0.stdout
 FILES+=                list_head.0
 FILES+=                list_head.0.stdout
 FILES+=                ncs.0
diff -r 245b110f802d -r ff86672035bd tests/usr.bin/indent/lineno.0
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/indent/lineno.0     Mon Mar 08 20:12:04 2021 +0000
@@ -0,0 +1,9 @@
+/* $NetBSD: lineno.0,v 1.1 2021/03/08 20:12:04 rillig Exp $ */
+/* $FreeBSD$ */
+
+/* Demonstrates line number counting in verbose mode. */
+
+int *
+function(void)
+{
+}
diff -r 245b110f802d -r ff86672035bd tests/usr.bin/indent/lineno.0.pro
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/indent/lineno.0.pro Mon Mar 08 20:12:04 2021 +0000
@@ -0,0 +1,4 @@
+/* $NetBSD: lineno.0.pro,v 1.1 2021/03/08 20:12:04 rillig Exp $ */
+/* $FreeBSD$ */
+
+-v
diff -r 245b110f802d -r ff86672035bd tests/usr.bin/indent/lineno.0.stdout
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/indent/lineno.0.stdout      Mon Mar 08 20:12:04 2021 +0000
@@ -0,0 +1,14 @@
+/* $NetBSD: lineno.0.stdout,v 1.1 2021/03/08 20:12:04 rillig Exp $ */
+/* $FreeBSD$ */
+
+/* Demonstrates line number counting in verbose mode. */
+
+int *
+function(void)
+{
+}
+/* $ In the below output, the '5' means 5 non-empty lines. */
+/* $ XXX: It's rather strange that -v writes to stdout, */
+/* $ even in filter mode.  This output belongs on stderr instead. */
+There were 5 output lines and 1 comments
+(Lines with comments)/(Lines with code):  0.250



Home | Main Index | Thread Index | Old Index