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 extra indentation in...



details:   https://anonhg.NetBSD.org/src/rev/d607887c7e8b
branches:  trunk
changeset: 376285:d607887c7e8b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jun 09 07:54:05 2023 +0000

description:
tests/indent: test extra indentation in expressions

diffstat:

 tests/usr.bin/indent/opt_eei.c |  61 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 60 insertions(+), 1 deletions(-)

diffs (72 lines):

diff -r ea2da65fb73d -r d607887c7e8b tests/usr.bin/indent/opt_eei.c
--- a/tests/usr.bin/indent/opt_eei.c    Fri Jun 09 07:20:30 2023 +0000
+++ b/tests/usr.bin/indent/opt_eei.c    Fri Jun 09 07:54:05 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_eei.c,v 1.12 2023/05/15 13:33:19 rillig Exp $ */
+/* $NetBSD: opt_eei.c,v 1.13 2023/06/09 07:54:05 rillig Exp $ */
 
 /*
  * Tests for the options '-eei' and '-neei'.
@@ -187,3 +187,62 @@ b)
            );
 }
 //indent end
+
+
+/*
+ * When multi-line expressions are aligned on the parentheses, they may have an
+ * ambiguous indentation as well.
+ */
+//indent input
+{
+       if (fun(
+               1,
+               2,
+               3))
+               stmt;
+}
+//indent end
+
+//indent run-equals-input
+
+//indent run -eei
+{
+       if (fun(
+// $ TODO: Indent one level further.
+               1,
+               2,
+               3))
+               stmt;
+}
+//indent end
+
+
+/*
+ *
+ */
+//indent input
+{
+       if (((
+               3
+       )))
+               stmt;
+       if ((((
+               4
+       ))))
+               stmt;
+}
+//indent end
+
+//indent run -ci2 -nlp -eei
+{
+       if (((
+             3
+           )))
+               stmt;
+// $ XXX: The indentation of '4' may be considered ambiguous.
+       if ((((
+               4
+             ))))
+               stmt;
+}
+//indent end



Home | Main Index | Thread Index | Old Index