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: change directive from '#'...



details:   https://anonhg.NetBSD.org/src/rev/8ff8877cebf8
branches:  trunk
changeset: 365770:8ff8877cebf8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Apr 24 09:04:12 2022 +0000

description:
tests/indent: change directive from '#' to '//'

Using a '//' instead of '#' turns the directives into well-formed C
code, resulting in fewer error markers in the editor.

diffstat:

 tests/usr.bin/indent/Makefile                          |   10 +-
 tests/usr.bin/indent/fmt_block.c                       |   22 +-
 tests/usr.bin/indent/fmt_decl.c                        |  288 ++++++++--------
 tests/usr.bin/indent/fmt_else_comment.c                |   18 +-
 tests/usr.bin/indent/fmt_expr.c                        |   10 +-
 tests/usr.bin/indent/indent_off_on.c                   |   82 ++--
 tests/usr.bin/indent/label.c                           |   26 +-
 tests/usr.bin/indent/lex_char.c                        |    8 +-
 tests/usr.bin/indent/lex_ident.c                       |   18 +-
 tests/usr.bin/indent/lex_string.c                      |   16 +-
 tests/usr.bin/indent/lsym_binary_op.c                  |   16 +-
 tests/usr.bin/indent/lsym_case_label.c                 |   30 +-
 tests/usr.bin/indent/lsym_colon.c                      |   32 +-
 tests/usr.bin/indent/lsym_comma.c                      |   62 +-
 tests/usr.bin/indent/lsym_comment.c                    |    8 +-
 tests/usr.bin/indent/lsym_do.c                         |    8 +-
 tests/usr.bin/indent/lsym_else.c                       |    8 +-
 tests/usr.bin/indent/lsym_eof.c                        |    8 +-
 tests/usr.bin/indent/lsym_for.c                        |    8 +-
 tests/usr.bin/indent/lsym_form_feed.c                  |    8 +-
 tests/usr.bin/indent/lsym_funcname.c                   |    8 +-
 tests/usr.bin/indent/lsym_if.c                         |    8 +-
 tests/usr.bin/indent/lsym_lbrace.c                     |   24 +-
 tests/usr.bin/indent/lsym_lparen_or_lbracket.c         |   96 ++--
 tests/usr.bin/indent/lsym_newline.c                    |    8 +-
 tests/usr.bin/indent/lsym_offsetof.c                   |   14 +-
 tests/usr.bin/indent/lsym_period.c                     |   26 +-
 tests/usr.bin/indent/lsym_postfix_op.c                 |   18 +-
 tests/usr.bin/indent/lsym_preprocessing.c              |   14 +-
 tests/usr.bin/indent/lsym_question.c                   |   28 +-
 tests/usr.bin/indent/lsym_rbrace.c                     |   24 +-
 tests/usr.bin/indent/lsym_return.c                     |   18 +-
 tests/usr.bin/indent/lsym_rparen_or_rbracket.c         |    8 +-
 tests/usr.bin/indent/lsym_semicolon.c                  |    8 +-
 tests/usr.bin/indent/lsym_sizeof.c                     |   14 +-
 tests/usr.bin/indent/lsym_storage_class.c              |    8 +-
 tests/usr.bin/indent/lsym_switch.c                     |    8 +-
 tests/usr.bin/indent/lsym_tag.c                        |    8 +-
 tests/usr.bin/indent/lsym_type_in_parentheses.c        |    8 +-
 tests/usr.bin/indent/lsym_type_outside_parentheses.c   |    8 +-
 tests/usr.bin/indent/lsym_typedef.c                    |   14 +-
 tests/usr.bin/indent/lsym_unary_op.c                   |    8 +-
 tests/usr.bin/indent/lsym_while.c                      |    8 +-
 tests/usr.bin/indent/lsym_word.c                       |   16 +-
 tests/usr.bin/indent/opt_P.c                           |   10 +-
 tests/usr.bin/indent/opt_T.c                           |   14 +-
 tests/usr.bin/indent/opt_bacc.c                        |   50 +-
 tests/usr.bin/indent/opt_bad.c                         |   32 +-
 tests/usr.bin/indent/opt_badp.c                        |   62 +-
 tests/usr.bin/indent/opt_bap.c                         |   12 +-
 tests/usr.bin/indent/opt_bap_sob.c                     |   14 +-
 tests/usr.bin/indent/opt_bbb.c                         |   12 +-
 tests/usr.bin/indent/opt_bc.c                          |   26 +-
 tests/usr.bin/indent/opt_bl_br.c                       |   38 +-
 tests/usr.bin/indent/opt_bs.c                          |   44 +-
 tests/usr.bin/indent/opt_c.c                           |   18 +-
 tests/usr.bin/indent/opt_cd.c                          |   12 +-
 tests/usr.bin/indent/opt_cdb.c                         |   60 +-
 tests/usr.bin/indent/opt_ce.c                          |   14 +-
 tests/usr.bin/indent/opt_ci.c                          |   84 ++--
 tests/usr.bin/indent/opt_cli.c                         |   14 +-
 tests/usr.bin/indent/opt_cs.c                          |   26 +-
 tests/usr.bin/indent/opt_d.c                           |   10 +-
 tests/usr.bin/indent/opt_di.c                          |   60 +-
 tests/usr.bin/indent/opt_dj.c                          |   32 +-
 tests/usr.bin/indent/opt_eei.c                         |   40 +-
 tests/usr.bin/indent/opt_ei.c                          |   16 +-
 tests/usr.bin/indent/opt_fbs.c                         |   14 +-
 tests/usr.bin/indent/opt_fc1.c                         |   46 +-
 tests/usr.bin/indent/opt_fcb.c                         |   58 +-
 tests/usr.bin/indent/opt_i.c                           |   10 +-
 tests/usr.bin/indent/opt_ip.c                          |   24 +-
 tests/usr.bin/indent/opt_l.c                           |   34 +-
 tests/usr.bin/indent/opt_lc.c                          |   10 +-
 tests/usr.bin/indent/opt_ldi.c                         |   30 +-
 tests/usr.bin/indent/opt_lp.c                          |   18 +-
 tests/usr.bin/indent/opt_lpl.c                         |   12 +-
 tests/usr.bin/indent/opt_pcs.c                         |   42 +-
 tests/usr.bin/indent/opt_psl.c                         |   36 +-
 tests/usr.bin/indent/opt_sc.c                          |   34 +-
 tests/usr.bin/indent/opt_sob.c                         |   14 +-
 tests/usr.bin/indent/opt_ta.c                          |   10 +-
 tests/usr.bin/indent/opt_ts.c                          |   10 +-
 tests/usr.bin/indent/opt_ut.c                          |   14 +-
 tests/usr.bin/indent/opt_v.c                           |   34 +-
 tests/usr.bin/indent/opt_version.c                     |   10 +-
 tests/usr.bin/indent/ps_ind_level.c                    |   30 +-
 tests/usr.bin/indent/psym_decl.c                       |    8 +-
 tests/usr.bin/indent/psym_do.c                         |    8 +-
 tests/usr.bin/indent/psym_do_stmt.c                    |    8 +-
 tests/usr.bin/indent/psym_else.c                       |    8 +-
 tests/usr.bin/indent/psym_for_exprs.c                  |   14 +-
 tests/usr.bin/indent/psym_if_expr.c                    |   10 +-
 tests/usr.bin/indent/psym_if_expr_stmt.c               |    8 +-
 tests/usr.bin/indent/psym_if_expr_stmt_else.c          |   22 +-
 tests/usr.bin/indent/psym_lbrace.c                     |    8 +-
 tests/usr.bin/indent/psym_rbrace.c                     |    8 +-
 tests/usr.bin/indent/psym_semicolon.c                  |    8 +-
 tests/usr.bin/indent/psym_stmt.c                       |    8 +-
 tests/usr.bin/indent/psym_stmt_list.c                  |    8 +-
 tests/usr.bin/indent/psym_switch_expr.c                |   16 +-
 tests/usr.bin/indent/psym_while_expr.c                 |   16 +-
 tests/usr.bin/indent/t_options.awk                     |   18 +-
 tests/usr.bin/indent/t_options.sh                      |   14 +-
 tests/usr.bin/indent/token_binary_op.c                 |   38 +-
 tests/usr.bin/indent/token_comment.c                   |  300 ++++++++--------
 tests/usr.bin/indent/token_decl.c                      |   10 +-
 tests/usr.bin/indent/token_do_stmt.c                   |   10 +-
 tests/usr.bin/indent/token_end_of_file.c               |   10 +-
 tests/usr.bin/indent/token_for_exprs.c                 |   20 +-
 tests/usr.bin/indent/token_form_feed.c                 |   18 +-
 tests/usr.bin/indent/token_funcname.c                  |    8 +-
 tests/usr.bin/indent/token_ident.c                     |   32 +-
 tests/usr.bin/indent/token_keyword_do.c                |   10 +-
 tests/usr.bin/indent/token_keyword_do_else.c           |   10 +-
 tests/usr.bin/indent/token_keyword_else.c              |   10 +-
 tests/usr.bin/indent/token_keyword_for_if_while.c      |   10 +-
 tests/usr.bin/indent/token_keyword_struct_union_enum.c |   24 +-
 tests/usr.bin/indent/token_newline.c                   |   10 +-
 tests/usr.bin/indent/token_postfix_op.c                |    8 +-
 tests/usr.bin/indent/token_preprocessing.c             |   52 +-
 tests/usr.bin/indent/token_rparen.c                    |    8 +-
 tests/usr.bin/indent/token_semicolon.c                 |   16 +-
 tests/usr.bin/indent/token_stmt.c                      |    8 +-
 tests/usr.bin/indent/token_stmt_list.c                 |    8 +-
 tests/usr.bin/indent/token_storage_class.c             |    8 +-
 tests/usr.bin/indent/token_string_prefix.c             |   18 +-
 tests/usr.bin/indent/token_switch_expr.c               |    8 +-
 tests/usr.bin/indent/token_type_def.c                  |    8 +-
 tests/usr.bin/indent/token_unary_op.c                  |   10 +-
 tests/usr.bin/indent/token_while_expr.c                |   10 +-
 131 files changed, 1575 insertions(+), 1575 deletions(-)

diffs (truncated from 9339 to 300 lines):

diff -r 044d8a07fb16 -r 8ff8877cebf8 tests/usr.bin/indent/Makefile
--- a/tests/usr.bin/indent/Makefile     Sun Apr 24 08:52:44 2022 +0000
+++ b/tests/usr.bin/indent/Makefile     Sun Apr 24 09:04:12 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.43 2022/04/24 08:48:17 rillig Exp $
+#      $NetBSD: Makefile,v 1.44 2022/04/24 09:04:12 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -159,13 +159,13 @@
                ' * TODO: Explain the purpose of the test.' \
                ' */' \
                '' \
-               '#indent input' \
+               '//indent input' \
                '// TODO: add input' \
-               '#indent end' \
+               '//indent end' \
                '' \
-               '#indent run [-options]' \
+               '//indent run [-options]' \
                '// TODO: add expected output' \
-               '#indent end' \
+               '//indent end' \
        > "$$test"; \
        cvs add "$$test"; \
        printf '%s\n' \
diff -r 044d8a07fb16 -r 8ff8877cebf8 tests/usr.bin/indent/fmt_block.c
--- a/tests/usr.bin/indent/fmt_block.c  Sun Apr 24 08:52:44 2022 +0000
+++ b/tests/usr.bin/indent/fmt_block.c  Sun Apr 24 09:04:12 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fmt_block.c,v 1.3 2022/04/22 21:21:20 rillig Exp $ */
+/* $NetBSD: fmt_block.c,v 1.4 2022/04/24 09:04:12 rillig Exp $ */
 
 /*
  * Tests for formatting blocks of statements and declarations.
@@ -9,7 +9,7 @@
  *     psym_stmt_list.c
  */
 
-#indent input
+//indent input
 void
 function(void)
 {
@@ -21,9 +21,9 @@
                print("block");
        }
 }
-#indent end
+//indent end
 
-#indent run
+//indent run
 void
 function(void)
 {
@@ -36,22 +36,22 @@
                print("block");
        }
 }
-#indent end
+//indent end
 
 
 /*
  * Two adjacent blocks must not be merged.  They are typically used in C90 and
  * earlier to declare local variables with a limited scope.
  */
-#indent input
+//indent input
 void
 function(void)
 {
        {}{}
 }
-#indent end
+//indent end
 
-#indent run
+//indent run
 void
 function(void)
 {
@@ -60,14 +60,14 @@
        } {
        }
 }
-#indent end
+//indent end
 
 /*
  * The buggy behavior only occurs with the default setting '-br', which
  * places an opening brace to the right of the preceding 'if (expr)' or
  * similar statements.
  */
-#indent run -bl
+//indent run -bl
 void
 function(void)
 {
@@ -76,4 +76,4 @@
        {
        }
 }
-#indent end
+//indent end
diff -r 044d8a07fb16 -r 8ff8877cebf8 tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c   Sun Apr 24 08:52:44 2022 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c   Sun Apr 24 09:04:12 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmt_decl.c,v 1.34 2022/04/24 08:52:44 rillig Exp $     */
+/*     $NetBSD: fmt_decl.c,v 1.35 2022/04/24 09:04:12 rillig Exp $     */
 
 /*
  * Tests for declarations of global variables, external functions, and local
@@ -14,32 +14,32 @@
  * A type definition usually declares a single type, so there is no need to
  * align the newly declared type name with the other variables.
  */
-#indent input
+//indent input
 typedef   void   (   *   function_ptr   )   (   int   *   )   ;
-#indent end
+//indent end
 
-#indent run
+//indent run
 typedef void (*function_ptr)(int *);
-#indent end
+//indent end
 
 
 /*
  * In variable declarations, the names of the first declarators are indented
  * by the amount given in '-di', which defaults to 16.
  */
-#indent input
+//indent input
 extern   void   (   *   function_pointer   )   (   int   *   )   ;
 extern   void   *   pointer;
-#indent end
+//indent end
 
-#indent run
+//indent run
 /* $ XXX: Why is the token 'function_pointer' not aligned with 'pointer'? */
 extern void    (*function_pointer)(int *);
 extern void    *pointer;
-#indent end
+//indent end
 
 
-#indent input
+//indent input
 static const struct
 {
        double          x;
@@ -52,9 +52,9 @@
                5
        }
 };
-#indent end
+//indent end
 
-#indent run
+//indent run
 static const struct {
        double          x;
        double          y, z;
@@ -66,23 +66,23 @@
                5
        }
 };
-#indent end
+//indent end
 
 
-#indent input
+//indent input
 typedef struct Complex
 {
        double          x;
        double          y;
 }      Complex;
-#indent end
+//indent end
 
-#indent run
+//indent run
 typedef struct Complex {
        double          x;
        double          y;
 }              Complex;
-#indent end
+//indent end
 
 
 /*
@@ -119,24 +119,24 @@
  * line 6: rbrace "}"
  * line 6: eof "\n"
  */
-#indent input
+//indent input
 void
 t1 (char *a, int b,
        void (*fn)(void))
 {}
-#indent end
+//indent end
 
-#indent run
+//indent run
 void
 t1(char *a, int b,
    void (*fn)(void))
 {
 }
-#indent end
+//indent end
 
 
 /* See opt_bc.c. */
-#indent input
+//indent input
 void t2 (char *x, int y)
 {
        int a,
@@ -158,9 +158,9 @@
        ;
        int             chars[ /* push the comma beyond column 74 .... */ ], x;
 }
-#indent end
+//indent end
 
-#indent run
+//indent run
 void
 t2(char *x, int y)
 {
@@ -176,103 +176,103 @@
        int             chars[ /* push the comma beyond column 74 .... */ ],
                        x;
 }
-#indent end
+//indent end
 
 
-#indent input
+//indent input
 const int      int_minimum_size =
 MAXALIGN(offsetof(int, test)) + MAXIMUM_ALIGNOF;
-#indent end
+//indent end
 
-#indent run-equals-input
+//indent run-equals-input
 
 
 /*
  * Ensure that the usual GCC-style function attributes are formatted in a
  * sensible way.
  */
-#indent input
+//indent input
 void function(const char *, ...) __attribute__((format(printf, 1, 2)));
-#indent end
+//indent end
 
 /* FIXME: missing space before '__attribute__' */
-#indent run -di0
+//indent run -di0
 void function(const char *, ...)__attribute__((format(printf, 1, 2)));
-#indent end
+//indent end
 
 /* FIXME: missing space before '__attribute__' */
-#indent run
+//indent run
 void           function(const char *, ...)__attribute__((format(printf, 1, 2)));
-#indent end
+//indent end
 
 
-#indent input
+//indent input
 static
 _attribute_printf(1, 2)
 void
 print_error(const char *fmt,...)
 {
 }
-#indent end
+//indent end
 
-#indent run
+//indent run
 static
 _attribute_printf(1, 2)



Home | Main Index | Thread Index | Old Index