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 that indent remember...



details:   https://anonhg.NetBSD.org/src/rev/2feb855cee84
branches:  trunk
changeset: 1024059:2feb855cee84
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 08 21:32:28 2021 +0000

description:
tests/indent: test that indent remembers unary/binary operators

diffstat:

 tests/usr.bin/indent/token-preprocessing.0        |  13 ++++++++++++-
 tests/usr.bin/indent/token-preprocessing.0.stdout |  13 ++++++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)

diffs (48 lines):

diff -r 82b6fd6bf8d8 -r 2feb855cee84 tests/usr.bin/indent/token-preprocessing.0
--- a/tests/usr.bin/indent/token-preprocessing.0        Fri Oct 08 21:24:40 2021 +0000
+++ b/tests/usr.bin/indent/token-preprocessing.0        Fri Oct 08 21:32:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token-preprocessing.0,v 1.4 2021/10/08 20:04:26 rillig Exp $ */
+/* $NetBSD: token-preprocessing.0,v 1.5 2021/10/08 21:32:28 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*-
@@ -57,3 +57,14 @@
 int s2 ;
 #define resolve_s '*/'
 int s3 ;
+
+/*
+ * A preprocessing directive inside an expression keeps the state about
+ * whether the next operator is unary or binary.
+ */
+int binary_plus = 3
+#define intermediate 1
+       +4;
+int unary_plus =
+#define intermediate 1
+       + 4;
diff -r 82b6fd6bf8d8 -r 2feb855cee84 tests/usr.bin/indent/token-preprocessing.0.stdout
--- a/tests/usr.bin/indent/token-preprocessing.0.stdout Fri Oct 08 21:24:40 2021 +0000
+++ b/tests/usr.bin/indent/token-preprocessing.0.stdout Fri Oct 08 21:32:28 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token-preprocessing.0.stdout,v 1.6 2021/10/08 20:14:52 rillig Exp $ */
+/* $NetBSD: token-preprocessing.0.stdout,v 1.7 2021/10/08 21:32:28 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*-
@@ -58,3 +58,14 @@
 int            s2;
 #define resolve_s '*/'
 int            s3;
+
+/*
+ * A preprocessing directive inside an expression keeps the state about
+ * whether the next operator is unary or binary.
+ */
+int            binary_plus = 3
+#define intermediate 1
++ 4;
+int            unary_plus =
+#define intermediate 1
++4;



Home | Main Index | Thread Index | Old Index