Home | History | Annotate | Line # | Download | only in indent
opt_bap.c revision 1.4
      1 /* $NetBSD: opt_bap.c,v 1.4 2021/11/19 22:24:29 rillig Exp $ */
      2 /* $FreeBSD$ */
      3 
      4 /*
      5  * Tests for the options '-bap' and '-nbap' ("blank line after procedure
      6  * body").
      7  *
      8  * The option '-bap' forces a blank line after every function body.
      9  *
     10  * The option '-nbap' keeps everything as is.
     11  *
     12  * FIXME: These options don't have any effect since at least 2000.
     13  * TODO: Investigate how nobody could have noticed this for 20 years.
     14  */
     15 
     16 #indent input
     17 static void one_liner(void){}
     18 static void several_lines(void)
     19 {
     20 	action();
     21 }
     22 int main(void){}
     23 int global_variable;
     24 
     25 void already_has_blank_line_below(void)
     26 {
     27 }
     28 
     29 void has_several_blank_lines_below(void)
     30 {
     31 }
     32 
     33 
     34 
     35 int		the_end;
     36 #indent end
     37 
     38 #indent run -bap
     39 static void
     40 one_liner(void)
     41 {
     42 }
     43 /* $ FIXME: needs a blank line here */
     44 static void
     45 several_lines(void)
     46 {
     47 	action();
     48 }
     49 /* $ FIXME: needs a blank line here */
     50 int
     51 main(void)
     52 {
     53 }
     54 /* $ FIXME: needs a blank line here */
     55 int		global_variable;
     56 
     57 void
     58 already_has_blank_line_below(void)
     59 {
     60 }
     61 
     62 void
     63 has_several_blank_lines_below(void)
     64 {
     65 }
     66 
     67 
     68 
     69 int		the_end;
     70 #indent end
     71 
     72 #indent run-equals-prev-output -nbap
     73