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: -badp should not add blan...



details:   https://anonhg.NetBSD.org/src/rev/c42c972c91fb
branches:  trunk
changeset: 375334:c42c972c91fb
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon May 15 09:05:08 2023 +0000

description:
tests/indent: -badp should not add blank lines in initializers

diffstat:

 tests/usr.bin/indent/opt_badp.c |  22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 9f6e8f8d1759 -r c42c972c91fb tests/usr.bin/indent/opt_badp.c
--- a/tests/usr.bin/indent/opt_badp.c   Mon May 15 09:00:51 2023 +0000
+++ b/tests/usr.bin/indent/opt_badp.c   Mon May 15 09:05:08 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_badp.c,v 1.10 2023/05/11 18:13:55 rillig Exp $ */
+/* $NetBSD: opt_badp.c,v 1.11 2023/05/15 09:05:08 rillig Exp $ */
 
 /*
  * Tests for the options '-badp' and '-nbadp'.
@@ -111,3 +111,23 @@ declaration_blank_blank_statement(void)
 //indent run-equals-input -badp
 
 //indent run-equals-input -nbadp
+
+
+/*
+ * A struct declaration or an initializer are not function bodies, so don't
+ * add a blank line after them.
+ */
+//indent input
+struct {
+       int member[2];
+} s = {
+       {
+               0,
+               0,
+       }
+};
+//indent end
+
+//indent run-equals-input -di0 -badp
+
+//indent run-equals-input -di0 -nbadp



Home | Main Index | Thread Index | Old Index