Module Name: src Committed By: rillig Date: Sat Mar 6 21:27:39 UTC 2021
Modified Files: src/tests/usr.bin/indent: opt-cd.0 opt-cd.0.stdout opt-cdb.0 opt-cdb.0.stdout opt-ce.0 opt-ce.0.stdout opt-ci.0 opt-ci.0.stdout opt-cli.0 opt-cli.0.stdout opt-cs.0 opt-cs.0.stdout opt-d.0 opt-d.0.stdout opt-di.0 opt-di.0.stdout opt-dj.0 opt-dj.0.stdout opt-eei.0 opt-eei.0.stdout opt-ei.0 opt-ei.0.stdout opt-fbs.0 opt-fbs.0.stdout opt-fc1.0 opt-fc1.0.stdout opt-nce.0 opt-nce.0.stdout opt-nei.0 opt-nei.0.stdout opt-nfbs.0 opt-nfbs.0.stdout opt-nfc1.0 opt-nfc1.0.stdout Log Message: tests/indent: add 17 more tests, found only a single new bug Discovering one bug in 17 command line options is acceptable. This compensates the bad first impression I got in the previous batch of tests, which consisted of 11 tests and found 8 bugs. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/indent/opt-cd.0 \ src/tests/usr.bin/indent/opt-cd.0.stdout \ src/tests/usr.bin/indent/opt-cdb.0 \ src/tests/usr.bin/indent/opt-cdb.0.stdout \ src/tests/usr.bin/indent/opt-ce.0 \ src/tests/usr.bin/indent/opt-ce.0.stdout \ src/tests/usr.bin/indent/opt-ci.0 \ src/tests/usr.bin/indent/opt-ci.0.stdout \ src/tests/usr.bin/indent/opt-cli.0 \ src/tests/usr.bin/indent/opt-cli.0.stdout \ src/tests/usr.bin/indent/opt-cs.0 \ src/tests/usr.bin/indent/opt-cs.0.stdout src/tests/usr.bin/indent/opt-d.0 \ src/tests/usr.bin/indent/opt-d.0.stdout src/tests/usr.bin/indent/opt-di.0 \ src/tests/usr.bin/indent/opt-di.0.stdout \ src/tests/usr.bin/indent/opt-dj.0 \ src/tests/usr.bin/indent/opt-dj.0.stdout \ src/tests/usr.bin/indent/opt-eei.0 \ src/tests/usr.bin/indent/opt-eei.0.stdout \ src/tests/usr.bin/indent/opt-ei.0 \ src/tests/usr.bin/indent/opt-ei.0.stdout \ src/tests/usr.bin/indent/opt-fbs.0 \ src/tests/usr.bin/indent/opt-fbs.0.stdout \ src/tests/usr.bin/indent/opt-fc1.0 \ src/tests/usr.bin/indent/opt-fc1.0.stdout \ src/tests/usr.bin/indent/opt-nce.0 \ src/tests/usr.bin/indent/opt-nce.0.stdout \ src/tests/usr.bin/indent/opt-nei.0 \ src/tests/usr.bin/indent/opt-nei.0.stdout \ src/tests/usr.bin/indent/opt-nfbs.0 \ src/tests/usr.bin/indent/opt-nfbs.0.stdout \ src/tests/usr.bin/indent/opt-nfc1.0 \ src/tests/usr.bin/indent/opt-nfc1.0.stdout Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/indent/opt-cd.0 diff -u src/tests/usr.bin/indent/opt-cd.0:1.1 src/tests/usr.bin/indent/opt-cd.0:1.2 --- src/tests/usr.bin/indent/opt-cd.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-cd.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt-cd.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-cd.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int aflag; /* Apply to all files. */ Index: src/tests/usr.bin/indent/opt-cd.0.stdout diff -u src/tests/usr.bin/indent/opt-cd.0.stdout:1.1 src/tests/usr.bin/indent/opt-cd.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-cd.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-cd.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt-cd.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-cd.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int aflag; /* Apply to all files. */ Index: src/tests/usr.bin/indent/opt-cdb.0 diff -u src/tests/usr.bin/indent/opt-cdb.0:1.1 src/tests/usr.bin/indent/opt-cdb.0:1.2 --- src/tests/usr.bin/indent/opt-cdb.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-cdb.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,45 @@ -/* $NetBSD: opt-cdb.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-cdb.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +/* A single-line comment. */ + +/* A + * multi-line + * comment. */ + +/* + * A + * multi-line + * comment. + */ + +int ga; /* A single-line comment. */ + +int gb; /* A + * multi-line + * comment. */ + +int gc; /* + * A + * multi-line + * comment. + */ + +void +example(void) +{ + /* A single-line comment. */ + int la; + + /* A + * multi-line + * comment. */ + int lb; + + /* + * A + * multi-line + * comment. + */ + int lc; +} Index: src/tests/usr.bin/indent/opt-cdb.0.stdout diff -u src/tests/usr.bin/indent/opt-cdb.0.stdout:1.1 src/tests/usr.bin/indent/opt-cdb.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-cdb.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-cdb.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,35 @@ -/* $NetBSD: opt-cdb.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-cdb.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +/* A single-line comment. */ + +/* + * A multi-line comment. + */ + +/* + * A multi-line comment. + */ + +int ga; /* A single-line comment. */ + +int gb; /* A multi-line comment. */ + +int gc; /* A multi-line comment. */ + +void +example(void) +{ + /* A single-line comment. */ + int la; + + /* + * A multi-line comment. + */ + int lb; + + /* + * A multi-line comment. + */ + int lc; +} Index: src/tests/usr.bin/indent/opt-ce.0 diff -u src/tests/usr.bin/indent/opt-ce.0:1.1 src/tests/usr.bin/indent/opt-ce.0:1.2 --- src/tests/usr.bin/indent/opt-ce.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-ce.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,11 @@ -/* $NetBSD: opt-ce.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-ce.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) +{ + if (n > 99) { print("large"); } + else if (n > 9) { print("double-digit"); } + else if (n > 0) print("positive"); + else { print("negative"); } +} Index: src/tests/usr.bin/indent/opt-ce.0.stdout diff -u src/tests/usr.bin/indent/opt-ce.0.stdout:1.1 src/tests/usr.bin/indent/opt-ce.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-ce.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-ce.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,16 @@ -/* $NetBSD: opt-ce.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-ce.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) +{ + if (n > 99) { + print("large"); + } else if (n > 9) { + print("double-digit"); + } else if (n > 0) + print("positive"); + else { + print("negative"); + } +} Index: src/tests/usr.bin/indent/opt-ci.0 diff -u src/tests/usr.bin/indent/opt-ci.0:1.1 src/tests/usr.bin/indent/opt-ci.0:1.2 --- src/tests/usr.bin/indent/opt-ci.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-ci.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,9 @@ -/* $NetBSD: opt-ci.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-ci.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int +sum(int a, int b) +{ + return a + + b; +} Index: src/tests/usr.bin/indent/opt-ci.0.stdout diff -u src/tests/usr.bin/indent/opt-ci.0.stdout:1.1 src/tests/usr.bin/indent/opt-ci.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-ci.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-ci.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,9 @@ -/* $NetBSD: opt-ci.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-ci.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int +sum(int a, int b) +{ + return a + + b; +} Index: src/tests/usr.bin/indent/opt-cli.0 diff -u src/tests/usr.bin/indent/opt-cli.0:1.1 src/tests/usr.bin/indent/opt-cli.0:1.2 --- src/tests/usr.bin/indent/opt-cli.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-cli.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,14 @@ -/* $NetBSD: opt-cli.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-cli.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +classify(int n) +{ + switch (n) { + case 0: print("zero"); break; + case 1: print("one"); break; + case 2: case 3: print("prime"); break; + case 4: print("square"); break; + default: print("large"); break; + } +} Index: src/tests/usr.bin/indent/opt-cli.0.stdout diff -u src/tests/usr.bin/indent/opt-cli.0.stdout:1.1 src/tests/usr.bin/indent/opt-cli.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-cli.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-cli.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,25 @@ -/* $NetBSD: opt-cli.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-cli.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +classify(int n) +{ + switch (n) { + case 0: + print("zero"); + break; + case 1: + print("one"); + break; + case 2: + case 3: + print("prime"); + break; + case 4: + print("square"); + break; + default: + print("large"); + break; + } +} Index: src/tests/usr.bin/indent/opt-cs.0 diff -u src/tests/usr.bin/indent/opt-cs.0:1.1 src/tests/usr.bin/indent/opt-cs.0:1.2 --- src/tests/usr.bin/indent/opt-cs.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-cs.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,6 @@ -/* $NetBSD: opt-cs.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-cs.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int i0 = (int)3.0; +int i1 = (int) 3.0; +int i3 = (int) 3.0; Index: src/tests/usr.bin/indent/opt-cs.0.stdout diff -u src/tests/usr.bin/indent/opt-cs.0.stdout:1.1 src/tests/usr.bin/indent/opt-cs.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-cs.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-cs.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,6 @@ -/* $NetBSD: opt-cs.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-cs.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int i0 = (int) 3.0; +int i1 = (int) 3.0; +int i3 = (int) 3.0; Index: src/tests/usr.bin/indent/opt-d.0 diff -u src/tests/usr.bin/indent/opt-d.0:1.1 src/tests/usr.bin/indent/opt-d.0:1.2 --- src/tests/usr.bin/indent/opt-d.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-d.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,19 @@ -/* $NetBSD: opt-d.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-d.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +/* XXX: oops, the comments at level 0 move below the '{' */ +void +example(void) +/* comment at level 0 */ + /* comment at level 0 */ +{ +/* comment at level 1 */ + /* comment at level 1 */ + /* comment at level 1 */ + { +/* comment at level 2 */ + /* comment at level 2 */ + /* comment at level 2 */ + /* comment at level 2 */ + } +} Index: src/tests/usr.bin/indent/opt-d.0.stdout diff -u src/tests/usr.bin/indent/opt-d.0.stdout:1.1 src/tests/usr.bin/indent/opt-d.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-d.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-d.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,19 @@ -/* $NetBSD: opt-d.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-d.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +/* XXX: oops, the comments at level 0 move below the '{' */ +void +example(void) +{ +/* comment at level 0 */ +/* comment at level 0 */ +/* comment at level 1 */ +/* comment at level 1 */ +/* comment at level 1 */ + { + /* comment at level 2 */ + /* comment at level 2 */ + /* comment at level 2 */ + /* comment at level 2 */ + } +} Index: src/tests/usr.bin/indent/opt-di.0 diff -u src/tests/usr.bin/indent/opt-di.0:1.1 src/tests/usr.bin/indent/opt-di.0:1.2 --- src/tests/usr.bin/indent/opt-di.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-di.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,8 @@ -/* $NetBSD: opt-di.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-di.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int space; +int tab; +int tab16; + +struct long_name long_name; Index: src/tests/usr.bin/indent/opt-di.0.stdout diff -u src/tests/usr.bin/indent/opt-di.0.stdout:1.1 src/tests/usr.bin/indent/opt-di.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-di.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-di.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,8 @@ -/* $NetBSD: opt-di.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-di.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int space; +int tab; +int tab16; + +struct long_name long_name; Index: src/tests/usr.bin/indent/opt-dj.0 diff -u src/tests/usr.bin/indent/opt-dj.0:1.1 src/tests/usr.bin/indent/opt-dj.0:1.2 --- src/tests/usr.bin/indent/opt-dj.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-dj.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,9 @@ -/* $NetBSD: opt-dj.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-dj.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int i; +int *ip; +const char *ccp; +const void *****vppppp; +const void ******vpppppp; +const void ********vpppppppp; Index: src/tests/usr.bin/indent/opt-dj.0.stdout diff -u src/tests/usr.bin/indent/opt-dj.0.stdout:1.1 src/tests/usr.bin/indent/opt-dj.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-dj.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-dj.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,9 @@ -/* $NetBSD: opt-dj.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-dj.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +int i; +int *ip; +const char *ccp; +const void *****vppppp; +const void ******vpppppp; +const void ********vpppppppp; Index: src/tests/usr.bin/indent/opt-eei.0 diff -u src/tests/usr.bin/indent/opt-eei.0:1.1 src/tests/usr.bin/indent/opt-eei.0:1.2 --- src/tests/usr.bin/indent/opt-eei.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-eei.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,14 @@ -/* $NetBSD: opt-eei.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-eei.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +bool +less(int a, int b) +{ + if (a < + b) + return true; + if (a + < + b) + return true; +} Index: src/tests/usr.bin/indent/opt-eei.0.stdout diff -u src/tests/usr.bin/indent/opt-eei.0.stdout:1.1 src/tests/usr.bin/indent/opt-eei.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-eei.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-eei.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,14 @@ -/* $NetBSD: opt-eei.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-eei.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +bool +less(int a, int b) +{ + if (a < + b) + return true; + if (a + < + b) + return true; +} Index: src/tests/usr.bin/indent/opt-ei.0 diff -u src/tests/usr.bin/indent/opt-ei.0:1.1 src/tests/usr.bin/indent/opt-ei.0:1.2 --- src/tests/usr.bin/indent/opt-ei.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-ei.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,16 @@ -/* $NetBSD: opt-ei.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-ei.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) +{ + if (n > 99) { + print("large"); + } else if (n > 9) { + print("double-digit"); + } else if (n > 0) + print("positive"); + else { + print("negative"); + } +} Index: src/tests/usr.bin/indent/opt-ei.0.stdout diff -u src/tests/usr.bin/indent/opt-ei.0.stdout:1.1 src/tests/usr.bin/indent/opt-ei.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-ei.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-ei.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,16 @@ -/* $NetBSD: opt-ei.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-ei.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) +{ + if (n > 99) { + print("large"); + } else if (n > 9) { + print("double-digit"); + } else if (n > 0) + print("positive"); + else { + print("negative"); + } +} Index: src/tests/usr.bin/indent/opt-fbs.0 diff -u src/tests/usr.bin/indent/opt-fbs.0:1.1 src/tests/usr.bin/indent/opt-fbs.0:1.2 --- src/tests/usr.bin/indent/opt-fbs.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-fbs.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt-fbs.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-fbs.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void example(int n) {} Index: src/tests/usr.bin/indent/opt-fbs.0.stdout diff -u src/tests/usr.bin/indent/opt-fbs.0.stdout:1.1 src/tests/usr.bin/indent/opt-fbs.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-fbs.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-fbs.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,7 @@ -/* $NetBSD: opt-fbs.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-fbs.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) +{ +} Index: src/tests/usr.bin/indent/opt-fc1.0 diff -u src/tests/usr.bin/indent/opt-fc1.0:1.1 src/tests/usr.bin/indent/opt-fc1.0:1.2 --- src/tests/usr.bin/indent/opt-fc1.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-fc1.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,10 @@ -/* $NetBSD: opt-fc1.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-fc1.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +/* + * A comment + * in column 1. + * + * + * + */ Index: src/tests/usr.bin/indent/opt-fc1.0.stdout diff -u src/tests/usr.bin/indent/opt-fc1.0.stdout:1.1 src/tests/usr.bin/indent/opt-fc1.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-fc1.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-fc1.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,9 @@ -/* $NetBSD: opt-fc1.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-fc1.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +/* + * A comment in column 1. + * + * + * + */ Index: src/tests/usr.bin/indent/opt-nce.0 diff -u src/tests/usr.bin/indent/opt-nce.0:1.1 src/tests/usr.bin/indent/opt-nce.0:1.2 --- src/tests/usr.bin/indent/opt-nce.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-nce.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,11 @@ -/* $NetBSD: opt-nce.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-nce.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) +{ + if (n > 99) { print("large"); } + else if (n > 9) { print("double-digit"); } + else if (n > 0) print("positive"); + else { print("negative"); } +} Index: src/tests/usr.bin/indent/opt-nce.0.stdout diff -u src/tests/usr.bin/indent/opt-nce.0.stdout:1.1 src/tests/usr.bin/indent/opt-nce.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-nce.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-nce.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,18 @@ -/* $NetBSD: opt-nce.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-nce.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) +{ + if (n > 99) { + print("large"); + } + else if (n > 9) { + print("double-digit"); + } + else if (n > 0) + print("positive"); + else { + print("negative"); + } +} Index: src/tests/usr.bin/indent/opt-nei.0 diff -u src/tests/usr.bin/indent/opt-nei.0:1.1 src/tests/usr.bin/indent/opt-nei.0:1.2 --- src/tests/usr.bin/indent/opt-nei.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-nei.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,16 @@ -/* $NetBSD: opt-nei.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-nei.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) +{ + if (n > 99) { + print("large"); + } else if (n > 9) { + print("double-digit"); + } else if (n > 0) + print("positive"); + else { + print("negative"); + } +} Index: src/tests/usr.bin/indent/opt-nei.0.stdout diff -u src/tests/usr.bin/indent/opt-nei.0.stdout:1.1 src/tests/usr.bin/indent/opt-nei.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-nei.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-nei.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,18 @@ -/* $NetBSD: opt-nei.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-nei.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) +{ + if (n > 99) { + print("large"); + } else + if (n > 9) { + print("double-digit"); + } else + if (n > 0) + print("positive"); + else { + print("negative"); + } +} Index: src/tests/usr.bin/indent/opt-nfbs.0 diff -u src/tests/usr.bin/indent/opt-nfbs.0:1.1 src/tests/usr.bin/indent/opt-nfbs.0:1.2 --- src/tests/usr.bin/indent/opt-nfbs.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-nfbs.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: opt-nfbs.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-nfbs.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void example(int n) {} Index: src/tests/usr.bin/indent/opt-nfbs.0.stdout diff -u src/tests/usr.bin/indent/opt-nfbs.0.stdout:1.1 src/tests/usr.bin/indent/opt-nfbs.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-nfbs.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-nfbs.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,6 @@ -/* $NetBSD: opt-nfbs.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-nfbs.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +void +example(int n) { +} Index: src/tests/usr.bin/indent/opt-nfc1.0 diff -u src/tests/usr.bin/indent/opt-nfc1.0:1.1 src/tests/usr.bin/indent/opt-nfc1.0:1.2 --- src/tests/usr.bin/indent/opt-nfc1.0:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-nfc1.0 Sat Mar 6 21:27:39 2021 @@ -1,4 +1,10 @@ -/* $NetBSD: opt-nfc1.0,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-nfc1.0,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +/* + * A comment + * in column 1. + * + * + * + */ Index: src/tests/usr.bin/indent/opt-nfc1.0.stdout diff -u src/tests/usr.bin/indent/opt-nfc1.0.stdout:1.1 src/tests/usr.bin/indent/opt-nfc1.0.stdout:1.2 --- src/tests/usr.bin/indent/opt-nfc1.0.stdout:1.1 Sat Mar 6 17:56:34 2021 +++ src/tests/usr.bin/indent/opt-nfc1.0.stdout Sat Mar 6 21:27:39 2021 @@ -1,4 +1,10 @@ -/* $NetBSD: opt-nfc1.0.stdout,v 1.1 2021/03/06 17:56:34 rillig Exp $ */ +/* $NetBSD: opt-nfc1.0.stdout,v 1.2 2021/03/06 21:27:39 rillig Exp $ */ /* $FreeBSD$ */ -/* TODO: implement the test */ +/* + * A comment + * in column 1. + * + * + * + */