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: clean up test for lbrace



details:   https://anonhg.NetBSD.org/src/rev/126d8de8f79b
branches:  trunk
changeset: 1024482:126d8de8f79b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Oct 25 20:16:16 2021 +0000

description:
tests/indent: clean up test for lbrace

After splitting token_type into separate types, want_blank_before_lparen
cannot depend on a parser_symbol anymore.

diffstat:

 tests/usr.bin/indent/token_lparen.c |  59 ++++++------------------------------
 1 files changed, 10 insertions(+), 49 deletions(-)

diffs (95 lines):

diff -r 789ee7162f2c -r 126d8de8f79b tests/usr.bin/indent/token_lparen.c
--- a/tests/usr.bin/indent/token_lparen.c       Mon Oct 25 19:56:03 2021 +0000
+++ b/tests/usr.bin/indent/token_lparen.c       Mon Oct 25 20:16:16 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token_lparen.c,v 1.6 2021/10/24 22:44:13 rillig Exp $ */
+/* $NetBSD: token_lparen.c,v 1.7 2021/10/25 20:16:16 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -96,10 +96,6 @@
 
 /*
  * Test want_blank_before_lparen for all possible token types.
- *
- * FIXME: As a side effect, this test demonstrates that line_no counting is
- *  broken. lparen_or_lbracket is in line 5, but during debugging it is said
- *  to be in line 4.
  */
 #indent input
 void cover_want_blank_before_lparen(void)
@@ -130,30 +126,12 @@
        switch (expr) {}
 #define preprocessing
        (preprocessing)();
-       /* $ XXX: tt_lex_form_feed should be skipped, just as newline. */
-       (tt_lex_form_feed)();  /* XXX: should be skipped */
+       /* $ XXX: lsym_form_feed should be skipped, just as newline. */
+       (lsym_form_feed)();    /* XXX: should be skipped */
        for(;;);
-       do(tt_lex_do)=3;while(0);
-       // $ TODO: is if_expr possible?
-       if(cond)(if_expr)();
-       // $ TODO: is while_expr possible?
-       while(cond)(while_expr)();
-       // $ TODO: is for_exprs possible?
-       for(;;)(for_exprs)();
-       // $ TODO: is stmt possible?
-       (stmt);
-       // $ TODO: is stmt_list possible?
-       (stmt_list);
-       // $ TODO: is tt_ps_else possible? tt_lex_else is.
-       if(cond);else(tt_ps_else)();
-       // $ TODO: is tt_ps_do possible? tt_lex_do is.
-       do(tt_ps_do);while(0);
-       // The following line would generate 'Statement nesting error'.
-       // do stmt;(do_stmt());while(0);
-       // $ TODO: is if_expr_stmt possible?
-       if(cond)stmt;(if_expr_stmt)();
-       // $ TODO: is if_expr_stmt_else possible?
-       if(cond)stmt;else(if_expr_stmt_else());
+       do(lsym_do)=3;while(0);
+       if(cond);else(lsym_else)();
+       do(lsym_do);while(0);
        str.(member);           /* syntax error */
        L("string_prefix");             /* impossible */
        static (int)storage_class;      /* syntax error */
@@ -198,34 +176,17 @@
        (preprocessing)();
 
 /* $ XXX: Where has the '\f' gone? It should have been preserved. */
-       (tt_lex_form_feed)();   /* XXX: should be skipped */
+       (lsym_form_feed)();     /* XXX: should be skipped */
        for (;;);
        do
-               (tt_lex_do) = 3;
+               (lsym_do) = 3;
        while (0);
-       if (cond)
-               (if_expr)();
-       while (cond)
-               (while_expr)();
-       for (;;)
-               (for_exprs)();
-       (stmt);
-       (stmt_list);
        if (cond);
        else
-               (tt_ps_else)();
+               (lsym_else)();
        do
-               (tt_ps_do);
+               (lsym_do);
        while (0);
-       // The following line would generate 'Statement nesting error'.
-       // do stmt;(do_stmt());while(0);
-       if (cond)
-               stmt;
-       (if_expr_stmt)();
-       if (cond)
-               stmt;
-       else
-               (if_expr_stmt_else());
        str.(member);           /* syntax error */
        L("string_prefix");     /* impossible */
        static (int)storage_class;      /* syntax error */



Home | Main Index | Thread Index | Old Index