Module Name: src
Committed By: rillig
Date: Mon May 15 08:22:23 UTC 2023
Modified Files:
src/tests/usr.bin/indent: psym_for_exprs.c
Log Message:
tests/indent: demonstrate wrong spacing in for loops
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/indent/psym_for_exprs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/indent/psym_for_exprs.c
diff -u src/tests/usr.bin/indent/psym_for_exprs.c:1.4 src/tests/usr.bin/indent/psym_for_exprs.c:1.5
--- src/tests/usr.bin/indent/psym_for_exprs.c:1.4 Sun Apr 24 09:04:12 2022
+++ src/tests/usr.bin/indent/psym_for_exprs.c Mon May 15 08:22:23 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: psym_for_exprs.c,v 1.4 2022/04/24 09:04:12 rillig Exp $ */
+/* $NetBSD: psym_for_exprs.c,v 1.5 2023/05/15 08:22:23 rillig Exp $ */
/*
* Tests for the parser state psym_for_exprs, which represents the state after
@@ -7,10 +7,31 @@
*/
//indent input
-// TODO: add input
+void
+for_loops(void)
+{
+ for (int i = 0; i < 10; i++)
+ printf("%d * %d = %d\n", i, 7, i * 7);
+
+ for (int i = 0; i < 10; i++) {
+ printf("%d * %d = %d\n", i, 7, i * 7);
+ }
+}
//indent end
-//indent run-equals-input
+//indent run
+void
+for_loops(void)
+{
+ for (int i = 0; i < 10; i++)
+ printf("%d * %d = %d\n", i, 7, i * 7);
+
+ /* $ FIXME: Add space between ')' and '{'. */
+ for (int i = 0; i < 10; i++){
+ printf("%d * %d = %d\n", i, 7, i * 7);
+ }
+}
+//indent end
/*
@@ -19,7 +40,7 @@
*/
//indent input
void
-function(void)
+small_scope(void)
{
for (int i = 0; i < 3; i++)
stmt();