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 variable indentation...



details:   https://anonhg.NetBSD.org/src/rev/b5b7fa948b9c
branches:  trunk
changeset: 1024635:b5b7fa948b9c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 30 10:52:43 2021 +0000

description:
tests/indent: test variable indentation with exotic options

diffstat:

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

diffs (71 lines):

diff -r e38349ab69a2 -r b5b7fa948b9c tests/usr.bin/indent/ps_ind_level.c
--- a/tests/usr.bin/indent/ps_ind_level.c       Sat Oct 30 10:47:03 2021 +0000
+++ b/tests/usr.bin/indent/ps_ind_level.c       Sat Oct 30 10:52:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ps_ind_level.c,v 1.1 2021/10/18 22:46:33 rillig Exp $ */
+/* $NetBSD: ps_ind_level.c,v 1.2 2021/10/30 10:52:43 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -59,3 +59,61 @@
                label:          ;
                        }
 #indent end
+
+
+/* Test the indentation computation in code_add_decl_indent. */
+#indent input
+int level_0;
+{
+int level_1;
+{
+int level_2;
+{
+int level_3;
+{
+int level_4;
+}
+}
+}
+}
+#indent end
+
+/*
+ * The variables are indented by 16, 21, 26, 31, 36.
+ * The variables end up in columns 17, 22, 27, 32, 37.
+ */
+#indent run -i5 -ts8 -di16 -ldi16
+int            level_0;
+{
+     int            level_1;
+     {
+         int             level_2;
+         {
+              int             level_3;
+              {
+                   int             level_4;
+              }
+         }
+     }
+}
+#indent end
+
+/*
+ * The variables are indented by 7, 12, 17, 22, 27.
+ * The variables end up in columns 8, 13, 18, 23, 28.
+ */
+#indent run -i5 -ts8 -di7 -ldi7
+int    level_0;
+{
+     int    level_1;
+     {
+         int    level_2;
+         {
+              int    level_3;
+              {
+                   int    level_4;
+              }
+         }
+     }
+}
+#indent end



Home | Main Index | Thread Index | Old Index