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: finally found some "optio...
details: https://anonhg.NetBSD.org/src/rev/bcd3f9db562c
branches: trunk
changeset: 989094:bcd3f9db562c
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Oct 11 17:02:55 2021 +0000
description:
tests/indent: finally found some "optional" blank lines
diffstat:
tests/usr.bin/indent/opt-nsob.0 | 38 ++++++++++++++++++++++++++++++++-
tests/usr.bin/indent/opt-nsob.0.stdout | 36 ++++++++++++++++++++++++++++++-
tests/usr.bin/indent/opt-sob.0 | 28 ++++++++++++++++++------
tests/usr.bin/indent/opt-sob.0.stdout | 11 ++++++++-
4 files changed, 101 insertions(+), 12 deletions(-)
diffs (212 lines):
diff -r 094ae0059f21 -r bcd3f9db562c tests/usr.bin/indent/opt-nsob.0
--- a/tests/usr.bin/indent/opt-nsob.0 Mon Oct 11 16:30:54 2021 +0000
+++ b/tests/usr.bin/indent/opt-nsob.0 Mon Oct 11 17:02:55 2021 +0000
@@ -1,12 +1,39 @@
-/* $NetBSD: opt-nsob.0,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
+/* $NetBSD: opt-nsob.0,v 1.3 2021/10/11 17:02:55 rillig Exp $ */
/* $FreeBSD$ */
void function_declaration(void);
+int
+function_with_0_blank_lines(void)
+{
+ int var;
+ var = value;
+ if (var > 0)
+ var--;
+ return var;
+}
int
-function_definition(void)
+function_with_1_blank_line(void)
+{
+
+ int var;
+
+ var = value;
+
+ if (var > 0)
+/* $ The following line is "optional" but is not removed due to '-nsob'. */
+
+ var--;
+
+ return var;
+
+}
+
+
+int
+function_with_2_blank_lines(void)
{
@@ -16,6 +43,13 @@
var = value;
+ if (var > 0)
+/* $ The following 2 lines are "optional" and are not removed due to '-nsob'. */
+
+
+ var--;
+
+
return var;
diff -r 094ae0059f21 -r bcd3f9db562c tests/usr.bin/indent/opt-nsob.0.stdout
--- a/tests/usr.bin/indent/opt-nsob.0.stdout Mon Oct 11 16:30:54 2021 +0000
+++ b/tests/usr.bin/indent/opt-nsob.0.stdout Mon Oct 11 17:02:55 2021 +0000
@@ -1,12 +1,38 @@
-/* $NetBSD: opt-nsob.0.stdout,v 1.2 2021/03/07 10:12:18 rillig Exp $ */
+/* $NetBSD: opt-nsob.0.stdout,v 1.3 2021/10/11 17:02:55 rillig Exp $ */
/* $FreeBSD$ */
void function_declaration(void);
+int
+function_with_0_blank_lines(void)
+{
+ int var;
+ var = value;
+ if (var > 0)
+ var--;
+ return var;
+}
int
-function_definition(void)
+function_with_1_blank_line(void)
+{
+
+ int var;
+
+ var = value;
+
+ if (var > 0)
+
+ var--;
+
+ return var;
+
+}
+
+
+int
+function_with_2_blank_lines(void)
{
@@ -16,6 +42,12 @@
var = value;
+ if (var > 0)
+
+
+ var--;
+
+
return var;
diff -r 094ae0059f21 -r bcd3f9db562c tests/usr.bin/indent/opt-sob.0
--- a/tests/usr.bin/indent/opt-sob.0 Mon Oct 11 16:30:54 2021 +0000
+++ b/tests/usr.bin/indent/opt-sob.0 Mon Oct 11 17:02:55 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt-sob.0,v 1.3 2021/10/11 16:30:54 rillig Exp $ */
+/* $NetBSD: opt-sob.0,v 1.4 2021/10/11 17:02:55 rillig Exp $ */
/* $FreeBSD$ */
/* $ FIXME: There are lots of 'optional blank lines' here that should */
@@ -9,20 +9,27 @@
int
function_with_0_blank_lines(void)
{
- int var;
- var = value;
- return var;
+ int var;
+ var = value;
+ if (var > 0)
+ var--;
+ return var;
}
int
function_with_1_blank_line(void)
{
- int var;
+ int var;
+
+ var = value;
- var = value;
+ if (var > 0)
+/* $ The following line is "optional" and is removed due to '-sob'. */
- return var;
+ var--;
+
+ return var;
}
@@ -38,6 +45,13 @@
var = value;
+ if (var > 0)
+/* $ The following 2 lines are "optional" and are removed due to '-sob'. */
+
+
+ var--;
+
+
return var;
diff -r 094ae0059f21 -r bcd3f9db562c tests/usr.bin/indent/opt-sob.0.stdout
--- a/tests/usr.bin/indent/opt-sob.0.stdout Mon Oct 11 16:30:54 2021 +0000
+++ b/tests/usr.bin/indent/opt-sob.0.stdout Mon Oct 11 17:02:55 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt-sob.0.stdout,v 1.3 2021/10/11 16:30:54 rillig Exp $ */
+/* $NetBSD: opt-sob.0.stdout,v 1.4 2021/10/11 17:02:55 rillig Exp $ */
/* $FreeBSD$ */
void function_declaration(void);
@@ -9,6 +9,8 @@
{
int var;
var = value;
+ if (var > 0)
+ var--;
return var;
}
@@ -20,6 +22,9 @@
var = value;
+ if (var > 0)
+ var--;
+
return var;
}
@@ -36,6 +41,10 @@
var = value;
+ if (var > 0)
+ var--;
+
+
return var;
Home |
Main Index |
Thread Index |
Old Index