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 spacing...



details:   https://anonhg.NetBSD.org/src/rev/5d0ea5b656b3
branches:  trunk
changeset: 375357:5d0ea5b656b3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon May 15 15:04:48 2023 +0000

description:
tests/indent: demonstrate wrong spacing after function prototype

diffstat:

 tests/usr.bin/indent/fmt_decl.c |  34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diffs (45 lines):

diff -r 9e60a4a00e70 -r 5d0ea5b656b3 tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c   Mon May 15 14:55:47 2023 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c   Mon May 15 15:04:48 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmt_decl.c,v 1.39 2023/05/15 14:55:47 rillig Exp $     */
+/*     $NetBSD: fmt_decl.c,v 1.40 2023/05/15 15:04:48 rillig Exp $     */
 
 /*
  * Tests for declarations of global variables, external functions, and local
@@ -887,3 +887,35 @@ char *(*fn)(int, int) = NULL;
 /* XXX: The parameter '(int)' is wrongly interpreted as a type cast. */
 /* XXX: The parameter '(int, int)' is wrongly interpreted as a type cast. */
 //indent run-equals-input -di0
+
+
+/*
+ * Depending on the line break in the function header, the spaces around the
+ * '||' operator were removed.
+ */
+//indent input
+bool is_identifier_start(char ch)
+{
+       return ch_isalpha(ch) || ch == '_';
+}
+
+bool
+is_identifier_start(char ch)
+{
+       return ch_isalpha(ch) || ch == '_';
+}
+//indent end
+
+//indent run
+bool
+is_identifier_start(char ch)
+{
+       return ch_isalpha(ch) || ch == '_';
+}
+
+bool
+is_identifier_start(char ch)
+{
+       return ch_isalpha(ch)||ch == '_';
+}
+//indent end



Home | Main Index | Thread Index | Old Index