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 bugs when for...



details:   https://anonhg.NetBSD.org/src/rev/0a4cbf587a72
branches:  trunk
changeset: 376124:0a4cbf587a72
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jun 02 11:26:21 2023 +0000

description:
tests/indent: demonstrate bugs when formatting preprocessing lines

diffstat:

 tests/usr.bin/indent/opt_bc.c |  36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diffs (47 lines):

diff -r d9258b978545 -r 0a4cbf587a72 tests/usr.bin/indent/opt_bc.c
--- a/tests/usr.bin/indent/opt_bc.c     Fri Jun 02 11:09:39 2023 +0000
+++ b/tests/usr.bin/indent/opt_bc.c     Fri Jun 02 11:26:21 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bc.c,v 1.6 2022/04/24 09:04:12 rillig Exp $ */
+/* $NetBSD: opt_bc.c,v 1.7 2023/06/02 11:26:21 rillig Exp $ */
 
 /*
  * Tests for the options '-bc' and '-nbc'.
@@ -63,3 +63,37 @@ double               a, b, c;
        return a + b + c;
 }
 //indent end
+
+
+//indent input
+int a,
+#if 0
+b, c; int d;
+#else
+b, c; int d;
+#endif
+//indent end
+
+//indent run -bc
+int            a,
+#if 0
+               b,
+               c;
+int            d;
+#else
+// $ FIXME: The '#else' branch must be indented like the '#if' branch.
+               b, c;
+int            d;
+#endif
+//indent end
+
+//indent run -nbc
+int            a,
+// $ FIXME: 'b, c' must not be merged into the preprocessing line.
+#if 0          b, c;
+int            d;
+#else
+               b, c;
+int            d;
+#endif
+//indent end



Home | Main Index | Thread Index | Old Index