Sun Jun 18 07:29:37 2023 UTC ()
indent: test block comments and the -bbb option


(rillig)
diff -r1.9 -r1.10 src/tests/usr.bin/indent/opt_bbb.c

cvs diff -r1.9 -r1.10 src/tests/usr.bin/indent/opt_bbb.c (switch to unified diff)

--- src/tests/usr.bin/indent/opt_bbb.c 2023/06/17 22:09:24 1.9
+++ src/tests/usr.bin/indent/opt_bbb.c 2023/06/18 07:29:36 1.10
@@ -1,89 +1,104 @@ @@ -1,89 +1,104 @@
1/* $NetBSD: opt_bbb.c,v 1.9 2023/06/17 22:09:24 rillig Exp $ */ 1/* $NetBSD: opt_bbb.c,v 1.10 2023/06/18 07:29:36 rillig Exp $ */
2 2
3/* 3/*
4 * Tests for the options '-bbb' and '-nbbb'. 4 * Tests for the options '-bbb' and '-nbbb'.
5 * 5 *
6 * The option '-bbb' forces a blank line before every block comment. 6 * The option '-bbb' forces a blank line before every block comment.
7 * 7 *
8 * The option '-nbbb' keeps everything as is. 8 * The option '-nbbb' keeps everything as is.
9 */ 9 */
10 10
11//indent input 11//indent input
12/* 12/*
13 * This is a block comment. 13 * This is a block comment.
14 */ 14 */
15/* This is not a block comment since it is single-line. */ 15/* This is not a block comment since it is single-line. */
16/* 16/*
17 * This is a second block comment. 17 * This is a second block comment.
18 */ 18 */
19/* This is not a block comment. */ 19/* This is not a block comment. */
20/* 20/*
21 * Documentation of global_variable. 21 * Documentation of global_variable.
22 */ 22 */
23int global_variable; 23int global_variable;
24/* 24/*
25 * Documentation of function_declaration. 25 * Documentation of function_declaration.
26 */ 26 */
27void function_declaration(void); 27void function_declaration(void);
28/* 28/*
29 * Documentation of function_definition. 29 * Documentation of function_definition.
30 */ 30 */
31void 31void
32function_definition(void) 32function_definition(void)
33{ 33{
34} 34}
35//indent end 35//indent end
36 36
37//indent run -bbb 37//indent run -bbb
38/* 38/*
39 * This is a block comment. 39 * This is a block comment.
40 */ 40 */
41/* This is not a block comment since it is single-line. */ 41/* This is not a block comment since it is single-line. */
42 42
43/* 43/*
44 * This is a second block comment. 44 * This is a second block comment.
45 */ 45 */
46/* This is not a block comment. */ 46/* This is not a block comment. */
47 47
48/* 48/*
49 * Documentation of global_variable. 49 * Documentation of global_variable.
50 */ 50 */
51int global_variable; 51int global_variable;
52 52
53/* 53/*
54 * Documentation of function_declaration. 54 * Documentation of function_declaration.
55 */ 55 */
56void function_declaration(void); 56void function_declaration(void);
57 57
58/* 58/*
59 * Documentation of function_definition. 59 * Documentation of function_definition.
60 */ 60 */
61void 61void
62function_definition(void) 62function_definition(void)
63{ 63{
64} 64}
65//indent end 65//indent end
66 66
67//indent run-equals-input -nbbb 67//indent run-equals-input -nbbb
68 68
69 69
70//indent input 70//indent input
71{ 71{
72label: /* not a block comment */ 72label: /* not a block comment */
73 stmt; /* not a block comment */ 73 stmt; /* not a block comment */
 74label: /*
 75 * This is not a block comment, as it goes to the right.
 76 */
 77 stmt; /*
 78 * This is not a block comment, as it goes to
 79 * the right.
 80 */
74 /** 81 /**
75 * block comment 82 * This is a block comment.
76 */ 83 */
77} 84}
78//indent end 85//indent end
79 86
80//indent run -bbb 87//indent run -bbb
81{ 88{
82label: /* not a block comment */ 89label: /* not a block comment */
83 stmt; /* not a block comment */ 90 stmt; /* not a block comment */
84 91
 92// $ TODO: No blank line before this comment.
 93label: /* This is not a block comment, as it goes to
 94 * the right. */
 95
 96// $ TODO: No blank line before this comment.
 97 stmt; /* This is not a block comment, as it goes to
 98 * the right. */
 99
85 /** 100 /**
86 * block comment 101 * This is a block comment.
87 */ 102 */
88} 103}
89//indent end 104//indent end