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: merge duplicate input/out...



details:   https://anonhg.NetBSD.org/src/rev/9c4b65013355
branches:  trunk
changeset: 1024313:9c4b65013355
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Oct 18 07:11:31 2021 +0000

description:
tests/indent: merge duplicate input/output and output/output

No functional change.

diffstat:

 tests/usr.bin/indent/opt_bacc.c   |   22 +-----
 tests/usr.bin/indent/opt_bad.c    |   10 +--
 tests/usr.bin/indent/opt_badp.c   |    4 +-
 tests/usr.bin/indent/opt_bap.c    |   33 +--------
 tests/usr.bin/indent/opt_cdb.c    |   10 +--
 tests/usr.bin/indent/opt_dj.c     |   11 +--
 tests/usr.bin/indent/opt_eei.c    |   16 +----
 tests/usr.bin/indent/opt_ei.c     |   18 +----
 tests/usr.bin/indent/opt_fc1.c    |   19 +----
 tests/usr.bin/indent/opt_fcb.c    |   34 +--------
 tests/usr.bin/indent/opt_ip.c     |   21 +-----
 tests/usr.bin/indent/opt_lpl.c    |   28 +-------
 tests/usr.bin/indent/opt_psl.c    |    6 +-
 tests/usr.bin/indent/opt_sc.c     |   14 +---
 tests/usr.bin/indent/t_options.sh |  131 +++++++++++++++++++++++++------------
 15 files changed, 119 insertions(+), 258 deletions(-)

diffs (truncated from 633 to 300 lines):

diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_bacc.c
--- a/tests/usr.bin/indent/opt_bacc.c   Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_bacc.c   Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bacc.c,v 1.2 2021/10/16 06:02:18 rillig Exp $ */
+/* $NetBSD: opt_bacc.c,v 1.3 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -39,13 +39,7 @@
  * With '-nbacc' the code is unchanged since there are no blank lines to
  * remove.
  */
-#indent run -nbacc
-int            a;
-#if 0
-int            b;
-#endif
-int            c;
-#indent end
+#indent run-equals-input -nbacc
 
 
 /* Example code containing blank lines. */
@@ -74,17 +68,7 @@
 #indent end
 
 /* The option '-nbacc' does not remove anything. */
-#indent run -nbacc
-int            space_a;
-
-#if 0
-
-int            space_b;
-
-#endif
-
-int            space_c;
-#indent end
+#indent run-equals-input -nbacc
 
 /*
  * Preprocessing directives can also occur in function bodies.
diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_bad.c
--- a/tests/usr.bin/indent/opt_bad.c    Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_bad.c    Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bad.c,v 1.2 2021/10/16 09:39:21 rillig Exp $ */
+/* $NetBSD: opt_bad.c,v 1.3 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -28,13 +28,7 @@
 /* comment */
 #indent end
 
-#indent run -nbad
-int            global_variable;
-void           function_declaration(void);
-#if 0
-#endif
-/* comment */
-#indent end
+#indent run-equals-prev-output -nbad
 
 /* Test local declarations. */
 #indent input
diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_badp.c
--- a/tests/usr.bin/indent/opt_badp.c   Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_badp.c   Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_badp.c,v 1.3 2021/10/17 17:20:47 rillig Exp $ */
+/* $NetBSD: opt_badp.c,v 1.4 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -76,4 +76,4 @@
 }
 #indent end
 
-#indent run-identity -nbadp -ldi0
+#indent run-equals-input -nbadp -ldi0
diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_bap.c
--- a/tests/usr.bin/indent/opt_bap.c    Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_bap.c    Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bap.c,v 1.2 2021/10/16 21:32:10 rillig Exp $ */
+/* $NetBSD: opt_bap.c,v 1.3 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -65,33 +65,4 @@
 int            the_end;
 #indent end
 
-#indent run -nbap
-static void
-one_liner(void)
-{
-}
-static void
-several_lines(void)
-{
-       action();
-}
-int
-main(void)
-{
-}
-int            global_variable;
-
-void
-already_has_blank_line_below(void)
-{
-}
-
-void
-has_several_blank_lines_below(void)
-{
-}
-
-
-
-int            the_end;
-#indent end
+#indent run-equals-prev-output -nbap
diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_cdb.c
--- a/tests/usr.bin/indent/opt_cdb.c    Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_cdb.c    Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_cdb.c,v 1.3 2021/10/16 21:32:10 rillig Exp $ */
+/* $NetBSD: opt_cdb.c,v 1.4 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -72,13 +72,7 @@
 int            gc;             /* A multi-line comment. */
 #indent end
 
-#indent run -ncdb
-int            ga;             /* A single-line comment. */
-
-int            gb;             /* A multi-line comment. */
-
-int            gc;             /* A multi-line comment. */
-#indent end
+#indent run-equals-prev-output -ncdb
 
 /*
  * Block comments that are inside a function.
diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_dj.c
--- a/tests/usr.bin/indent/opt_dj.c     Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_dj.c     Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_dj.c,v 1.2 2021/10/16 21:32:10 rillig Exp $ */
+/* $NetBSD: opt_dj.c,v 1.3 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -28,14 +28,7 @@
 const void ********vpppppppp;
 #indent end
 
-#indent run -ndj
-int            i;
-int           *ip;
-const char     *ccp;
-const void *****vppppp;
-const void ******vpppppp;
-const void ********vpppppppp;
-#indent end
+#indent run-equals-prev-output -ndj
 
 #indent input
 void example(void) {
diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_eei.c
--- a/tests/usr.bin/indent/opt_eei.c    Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_eei.c    Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_eei.c,v 1.3 2021/10/16 21:32:10 rillig Exp $ */
+/* $NetBSD: opt_eei.c,v 1.4 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -40,19 +40,7 @@
 }
 #indent end
 
-#indent run -neei
-bool
-less(int a, int b)
-{
-       if (a <
-           b)
-               return true;
-       if (a
-           <
-           b)
-               return true;
-}
-#indent end
+#indent run-equals-input -neei
 
 /*
  * When the indentation level is the same as the continuation indentation, the
diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_ei.c
--- a/tests/usr.bin/indent/opt_ei.c     Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_ei.c     Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_ei.c,v 1.3 2021/10/16 21:32:10 rillig Exp $ */
+/* $NetBSD: opt_ei.c,v 1.4 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -27,21 +27,7 @@
 }
 #indent end
 
-#indent run -ei
-void
-example(int n)
-{
-       if (n > 99) {
-               print("large");
-       } else if (n > 9) {
-               print("double-digit");
-       } else if (n > 0)
-               print("positive");
-       else {
-               print("negative");
-       }
-}
-#indent end
+#indent run-equals-input -ei
 
 #indent run -nei
 void
diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_fc1.c
--- a/tests/usr.bin/indent/opt_fc1.c    Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_fc1.c    Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_fc1.c,v 1.3 2021/10/16 21:32:10 rillig Exp $ */
+/* $NetBSD: opt_fc1.c,v 1.4 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -28,15 +28,7 @@
  */
 #indent end
 
-#indent run -nfc1
-/*
- * A comment
- * in column 1.
- *
- *
- *
- */
-#indent end
+#indent run-equals-input -nfc1
 
 
 #indent input
@@ -146,9 +138,4 @@
                                 * second comment */
 #indent end
 
-#indent run -nfc1
- /* comment */ int decl2;      /* comment */
- /* looooooooooooooooooooooooooooooooooooooooong first comment */ int decl2;   /* second comment */
- /* first comment */ int decl2;        /* looooooooooooooooooooooooooooooooooooooooong
-                                * second comment */
-#indent end
+#indent run-equals-prev-output -nfc1
diff -r 35b8e6e124d5 -r 9c4b65013355 tests/usr.bin/indent/opt_fcb.c
--- a/tests/usr.bin/indent/opt_fcb.c    Sun Oct 17 22:44:34 2021 +0000
+++ b/tests/usr.bin/indent/opt_fcb.c    Mon Oct 18 07:11:31 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_fcb.c,v 1.3 2021/10/16 21:32:10 rillig Exp $ */
+/* $NetBSD: opt_fcb.c,v 1.4 2021/10/18 07:11:31 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -40,19 +40,7 @@
  */
 #indent end
 
-#indent run -nfcb
-/*
- * Not
- *
- * so carefully formatted comment
- */
-
-/*-
- * car         mat         men
- *    efu   for   ted   com   t
- *       lly         box       .
- */
-#indent end



Home | Main Index | Thread Index | Old Index