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 tokeniz...
details: https://anonhg.NetBSD.org/src/rev/f4740adc8af5
branches: trunk
changeset: 376404:f4740adc8af5
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Jun 16 11:58:33 2023 +0000
description:
tests/indent: demonstrate wrong tokenization after typedef
Since 2023-06-10 06:52, which fixed the indentation of C11 _Generic
expressions.
diffstat:
tests/usr.bin/indent/lsym_typedef.c | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diffs (35 lines):
diff -r 75eeea48d7e6 -r f4740adc8af5 tests/usr.bin/indent/lsym_typedef.c
--- a/tests/usr.bin/indent/lsym_typedef.c Fri Jun 16 11:48:32 2023 +0000
+++ b/tests/usr.bin/indent/lsym_typedef.c Fri Jun 16 11:58:33 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_typedef.c,v 1.6 2022/04/24 10:36:37 rillig Exp $ */
+/* $NetBSD: lsym_typedef.c,v 1.7 2023/06/16 11:58:33 rillig Exp $ */
/*
* Tests for the token lsym_typedef, which represents the keyword 'typedef'
@@ -59,3 +59,25 @@ typedef int number;
//indent end
//indent run-equals-input
+
+
+/*
+ * Ensure that a typedef declaration does not introduce an unnecessary line
+ * break after the '}'.
+ */
+//indent input
+typedef struct {
+ int member;
+ bool bit:1;
+} typedef_name;
+//indent end
+
+//indent run -di0
+typedef struct {
+ int member;
+// $ FIXME: No space after the ':' here.
+ bool bit: 1;
+}
+// $ FIXME: No linebreak here.
+typedef_name;
+//indent end
Home |
Main Index |
Thread Index |
Old Index