Module Name: src
Committed By: rillig
Date: Mon Jun 5 15:02:54 UTC 2023
Modified Files:
src/tests/usr.bin/indent: fmt_decl.c opt_dj.c
Log Message:
tests/indent: add test for left-justifying declarations
To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/indent/opt_dj.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.48 src/tests/usr.bin/indent/fmt_decl.c:1.49
--- src/tests/usr.bin/indent/fmt_decl.c:1.48 Fri Jun 2 14:34:14 2023
+++ src/tests/usr.bin/indent/fmt_decl.c Mon Jun 5 15:02:54 2023
@@ -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
Index: src/tests/usr.bin/indent/opt_dj.c
diff -u src/tests/usr.bin/indent/opt_dj.c:1.7 src/tests/usr.bin/indent/opt_dj.c:1.8
--- src/tests/usr.bin/indent/opt_dj.c:1.7 Sun Apr 24 09:04:12 2022
+++ src/tests/usr.bin/indent/opt_dj.c Mon Jun 5 15:02:54 2023
@@ -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