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 interaction between ...



details:   https://anonhg.NetBSD.org/src/rev/c7858d0719e5
branches:  trunk
changeset: 374773:c7858d0719e5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu May 11 21:36:31 2023 +0000

description:
tests/indent: test interaction between preprocessing and comments

diffstat:

 tests/usr.bin/indent/lsym_preprocessing.c |  32 ++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r 7c842735298b -r c7858d0719e5 tests/usr.bin/indent/lsym_preprocessing.c
--- a/tests/usr.bin/indent/lsym_preprocessing.c Thu May 11 20:08:59 2023 +0000
+++ b/tests/usr.bin/indent/lsym_preprocessing.c Thu May 11 21:36:31 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_preprocessing.c,v 1.8 2023/05/11 19:01:35 rillig Exp $ */
+/* $NetBSD: lsym_preprocessing.c,v 1.9 2023/05/11 21:36:31 rillig Exp $ */
 
 /*
  * Tests for the token lsym_preprocessing, which represents a '#' that starts
@@ -241,3 +241,33 @@ do {                               \
 //indent end
 
 //indent run-equals-input
+
+
+/*
+ * The 'INDENT OFF' state is global, it does not depend on the preprocessing
+ * directives, otherwise the declarations for 'on' and 'after' would be moved
+ * to column 1.
+ */
+//indent input
+int first_line;
+       int before;
+#if 0
+/*INDENT OFF*/
+       int off;
+#else
+       int on;
+#endif
+       int after;
+//indent end
+
+//indent run -di0
+int first_line;
+int before;
+#if 0
+/*INDENT OFF*/
+       int off;
+#else
+       int on;
+#endif
+       int after;
+//indent end



Home | Main Index | Thread Index | Old Index