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: test edge cases for blank...



details:   https://anonhg.NetBSD.org/src/rev/e076debf285c
branches:  trunk
changeset: 990416:e076debf285c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Oct 26 20:37:26 2021 +0000

description:
tests/indent: test edge cases for blank after sizeof

diffstat:

 tests/usr.bin/indent/opt_bs.c |  24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diffs (35 lines):

diff -r f92c258f9174 -r e076debf285c tests/usr.bin/indent/opt_bs.c
--- a/tests/usr.bin/indent/opt_bs.c     Tue Oct 26 20:37:18 2021 +0000
+++ b/tests/usr.bin/indent/opt_bs.c     Tue Oct 26 20:37:26 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bs.c,v 1.4 2021/10/24 11:42:57 rillig Exp $ */
+/* $NetBSD: opt_bs.c,v 1.5 2021/10/26 20:37:26 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -97,3 +97,25 @@
 int offset = offsetof(struct s, member);
 int offset = offsetof(struct s, member);
 #indent end
+
+
+/* Ensure that there is no blank before 'sizeof(' if there is a '\n' between. */
+#indent input
+int sizeof_newline = sizeof
+(0);
+#indent end
+
+#indent run-equals-input -di0 -bs
+#indent run-equals-input -di0 -nbs
+
+
+/* Ensure that only the first '(' after 'sizeof' gets a blank. */
+#indent input
+int sizeof_parenthesized = sizeof((0));
+#indent end
+
+#indent run -di0 -bs
+int sizeof_parenthesized = sizeof ((0));
+#indent end
+
+#indent run-equals-input -di0 -nbs



Home | Main Index | Thread Index | Old Index