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: add test for left-justify...



details:   https://anonhg.NetBSD.org/src/rev/2de8ed5032b1
branches:  trunk
changeset: 376238:2de8ed5032b1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jun 05 15:02:54 2023 +0000

description:
tests/indent: add test for left-justifying declarations

diffstat:

 tests/usr.bin/indent/fmt_decl.c |  20 ++++++++++-
 tests/usr.bin/indent/opt_dj.c   |  76 ++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 94 insertions(+), 2 deletions(-)

diffs (118 lines):

diff -r e7e838c93cea -r 2de8ed5032b1 tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c   Mon Jun 05 14:40:13 2023 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c   Mon Jun 05 15:02:54 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmt_decl.c,v 1.48 2023/06/02 14:34:14 rillig Exp $     */
+/*     $NetBSD: fmt_decl.c,v 1.49 2023/06/05 15:02:54 rillig Exp $     */
 
 /*
  * Tests for declarations of global variables, external functions, and local
@@ -974,3 +974,21 @@ void
 {
 }
 //indent end
+
+
+//indent input
+struct a {
+       struct b {
+               struct c {
+                       struct d1 {
+                               int e;
+                       } d1;
+                       struct d2 {
+                               int e;
+                       } d2;
+               } c;
+       } b;
+};
+//indent end
+
+//indent run-equals-input -di0
diff -r e7e838c93cea -r 2de8ed5032b1 tests/usr.bin/indent/opt_dj.c
--- a/tests/usr.bin/indent/opt_dj.c     Mon Jun 05 14:40:13 2023 +0000
+++ b/tests/usr.bin/indent/opt_dj.c     Mon Jun 05 15:02:54 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_dj.c,v 1.7 2022/04/24 09:04:12 rillig Exp $ */
+/* $NetBSD: opt_dj.c,v 1.8 2023/06/05 15:02:54 rillig Exp $ */
 
 /*
  * Tests for the options '-dj' and '-ndj'.
@@ -76,3 +76,77 @@ dbl_plus3(a, b, c)
        return a + b + c;
 }
 //indent end
+
+
+//indent input
+struct a {
+       struct b {
+               struct c {
+                       struct d1 {
+                               int e;
+                       } d1;
+                       struct d2 {
+                               int e;
+                       } d2;
+               } c;
+       } b;
+};
+//indent end
+
+//indent run -d0
+struct a {
+       struct b {
+               struct c {
+                       struct d1 {
+                               int             e;
+                       }               d1;
+                       struct d2 {
+                               int             e;
+                       }               d2;
+               }               c;
+       }               b;
+};
+//indent end
+
+//indent run-equals-input -di0
+
+//indent run-equals-prev-output -dj
+
+
+//indent input
+{
+       {
+               struct a {
+                       struct b {
+                               struct c {
+                                       struct d1 {
+                                               int e;
+                                       } d1;
+                                       struct d2 {
+                                               int e;
+                                       } d2;
+                               } c;
+                       } b;
+               };
+       }
+}
+//indent end
+
+//indent run -dj
+{
+       {
+struct a {
+       struct b {
+               struct c {
+                       struct d1 {
+                               int             e;
+                       }               d1;
+                       struct d2 {
+                               int             e;
+                       }               d2;
+               }               c;
+       }               b;
+};
+       }
+}
+//indent end



Home | Main Index | Thread Index | Old Index