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: demonstrate wrong indenta...



details:   https://anonhg.NetBSD.org/src/rev/e59eb785ba58
branches:  trunk
changeset: 375350:e59eb785ba58
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon May 15 13:53:32 2023 +0000

description:
tests/indent: demonstrate wrong indentation of struct members

diffstat:

 tests/usr.bin/indent/lsym_tag.c |  31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diffs (42 lines):

diff -r e3796fdd3521 -r e59eb785ba58 tests/usr.bin/indent/lsym_tag.c
--- a/tests/usr.bin/indent/lsym_tag.c   Mon May 15 13:37:16 2023 +0000
+++ b/tests/usr.bin/indent/lsym_tag.c   Mon May 15 13:53:32 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_tag.c,v 1.5 2022/04/24 10:36:37 rillig Exp $ */
+/* $NetBSD: lsym_tag.c,v 1.6 2023/05/15 13:53:32 rillig Exp $ */
 
 /*
  * Tests for the token lsym_tag, which represents one of the keywords
@@ -114,3 +114,32 @@ struct   /* comment */   tag var;
 //indent run -di0
 struct /* comment */ tag var;
 //indent end
+
+
+/*
+ * Ensure that the names of struct members are all indented the same.
+ * Before XXXX-XX-XX, the indentation depended on their type name.
+ */
+//indent input
+struct {
+       enum {
+               untagged_constant,
+       } untagged_member;
+       enum tag_name {
+               tagged_constant,
+       } tagged_member;
+};
+//indent end
+
+//indent run -di0
+struct {
+       enum {
+               untagged_constant,
+       }    untagged_member;
+       /* $ FIXME: 4 spaces above, should be 1. */
+       enum tag_name {
+               tagged_constant,
+       }        tagged_member;
+       /* $ FIXME: 8 spaces above, should be 1. */
+};
+//indent end



Home | Main Index | Thread Index | Old Index