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: test form feed in comments



details:   https://anonhg.NetBSD.org/src/rev/9e364c25264a
branches:  trunk
changeset: 990049:9e364c25264a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Oct 24 21:48:16 2021 +0000

description:
tests/indent: test form feed in comments

diffstat:

 tests/usr.bin/indent/token_comment.c |  38 +++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diffs (49 lines):

diff -r b638771c8ff2 -r 9e364c25264a tests/usr.bin/indent/token_comment.c
--- a/tests/usr.bin/indent/token_comment.c      Sun Oct 24 20:57:11 2021 +0000
+++ b/tests/usr.bin/indent/token_comment.c      Sun Oct 24 21:48:16 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token_comment.c,v 1.5 2021/10/19 20:41:42 rillig Exp $ */
+/* $NetBSD: token_comment.c,v 1.6 2021/10/24 21:48:16 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -678,3 +678,39 @@
 // end-of-line comment at the end of the file
 #indent end
 #indent run-equals-input
+
+
+/* A form feed in the middle of a comment is an ordinary character. */
+#indent input
+/*
+ * AE
+ */
+/*-AE*/
+#indent end
+#indent run-equals-input
+
+/*
+ * At the beginning of a block comment or after a '*', '\f' is special. This
+ * is an implementation detail that should not be visible from the outside.
+ * Form feeds in comments are seldom used though, so this is no problem.
+ */
+#indent input
+/* comment*/
+/*text* comment*/
+#indent end
+
+#indent run
+/* * comment */
+/* text* * comment */
+#indent end
+
+/*
+ * Without 'star_comment_cont', there is no separator between the form feed
+ * and the surrounding text.
+ */
+#indent run -nsc
+/*comment */
+/* text*comment */
+#indent end
+
+#indent run-equals-input -nfc1



Home | Main Index | Thread Index | Old Index