xref: /netbsd-src/tests/usr.bin/indent/opt_cs.c (revision 2718af68c3efc72c9769069b5c7f9ed36f6b9def)
1 /* $NetBSD: opt_cs.c,v 1.4 2021/11/07 15:44:28 rillig Exp $ */
2 /* $FreeBSD$ */
3 
4 /*
5  * Tests for the options '-cs' and '-ncs'.
6  *
7  * The option '-cs' forces a space after the parentheses of a cast.
8  *
9  * The option '-ncs' removes all whitespace after the parentheses of a cast.
10  */
11 
12 #indent input
13 int		i0 = (int)3.0;
14 int		i1 = (int) 3.0;
15 int		i3 = (int)   3.0;
16 #indent end
17 
18 #indent run -cs
19 int		i0 = (int) 3.0;
20 int		i1 = (int) 3.0;
21 int		i3 = (int) 3.0;
22 #indent end
23 
24 #indent run -ncs
25 int		i0 = (int)3.0;
26 int		i1 = (int)3.0;
27 int		i3 = (int)3.0;
28 #indent end
29 
30 
31 #indent input
32 struct s	s3 = (struct s)   s;
33 struct s       *ptr = (struct s *)   s;
34 union u		u3 = (union u)   u;
35 enum e		e3 = (enum e)   e;
36 #indent end
37 
38 #indent run -cs
39 struct s	s3 = (struct s) s;
40 struct s       *ptr = (struct s *) s;
41 union u		u3 = (union u) u;
42 enum e		e3 = (enum e) e;
43 #indent end
44 
45 #indent run -ncs
46 struct s	s3 = (struct s)s;
47 struct s       *ptr = (struct s *)s;
48 union u		u3 = (union u)u;
49 enum e		e3 = (enum e)e;
50 #indent end
51