xref: /netbsd-src/tests/usr.bin/indent/opt_ut.c (revision 47306038c7d906b62edca1fd252c0e0d0772f5a0)
1 /* $NetBSD: opt_ut.c,v 1.5 2022/04/24 09:04:12 rillig Exp $ */
2 
3 /*
4  * Tests for the options '-ut' and '-nut'.
5  *
6  * The option '-ut' uses tabs for indentation and alignment.
7  *
8  * The option '-nut' uses only spaces for indentation and alignment.
9  */
10 
11 //indent input
12 int variable;
13 
14 void function_declaration(void);
15 
16 void
function_definition(void)17 function_definition(void)
18 {
19 int local_variable;
20 
21 if (arg > 0)
22 function(
23 arg - 1
24 );
25 }
26 //indent end
27 
28 //indent run -ut
29 int		variable;
30 
31 void		function_declaration(void);
32 
33 void
function_definition(void)34 function_definition(void)
35 {
36 	int		local_variable;
37 
38 	if (arg > 0)
39 		function(
40 			 arg - 1
41 			);
42 }
43 //indent end
44 
45 //indent run -nut
46 int             variable;
47 
48 void            function_declaration(void);
49 
50 void
function_definition(void)51 function_definition(void)
52 {
53         int             local_variable;
54 
55         if (arg > 0)
56                 function(
57                          arg - 1
58                         );
59 }
60 //indent end
61