summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-05-03 08:42:22 +0000
committerrillig <rillig@pkgsrc.org>2020-05-03 08:42:22 +0000
commit68c727828e7698b8a7127f49bc99de4d0618ed36 (patch)
treeb8d79887520e0c776752f2cd16a5133b1a5e1649 /regress
parent45d99062effcf1dedd70edcd96f8e207bb6119a7 (diff)
downloadpkgsrc-68c727828e7698b8a7127f49bc99de4d0618ed36.tar.gz
regress/infra-unittests: demonstrate wrong help topics without keywords
Diffstat (limited to 'regress')
-rw-r--r--regress/infra-unittests/help.sh30
1 files changed, 29 insertions, 1 deletions
diff --git a/regress/infra-unittests/help.sh b/regress/infra-unittests/help.sh
index 98eac24a2f5..c117aeaa28d 100644
--- a/regress/infra-unittests/help.sh
+++ b/regress/infra-unittests/help.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# $NetBSD: help.sh,v 1.1 2020/03/30 06:40:53 rillig Exp $
+# $NetBSD: help.sh,v 1.2 2020/05/03 08:42:22 rillig Exp $
#
# Test cases for "bmake help", mainly implemented in mk/help/help.awk.
#
@@ -92,3 +92,31 @@ if test_case_begin "short help topic"; then
test_case_end
fi
+
+
+if test_case_begin "comments without keywords"; then
+
+ # In the top-level Makefile, the SUBDIR section contains a few
+ # comment lines, which are implementation comments and do not
+ # contain keywords. These should not appear in the help.
+
+ create_file_lines "Makefile" \
+ 'SUBDIR+= subdir1' \
+ '# Comment1' \
+ '# Comment2' \
+ '# Comment3' \
+ 'SUBDIR+= subdir2'
+
+ TOPIC=':all' awk -f "$pkgsrcdir/mk/help/help.awk" \
+ 'Makefile' >"out"
+
+ # FIXME: should be empty
+ assert_that 'out' --file-is-lines \
+ '===> Makefile (keywords:):' \
+ '# Comment1' \
+ '# Comment2' \
+ '# Comment3' \
+ 'SUBDIR+= subdir2'
+
+ test_case_end
+fi