diff options
| author | rillig <rillig@NetBSD.org> | 2021-09-24 06:30:02 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2021-09-24 06:30:02 +0000 |
| commit | 48cc8fae8e296227a45dcd8127567abc7e69ff4e (patch) | |
| tree | dd2dce2f40625ca061f32678bc9f939dd3feca03 | |
| parent | afa2ce3a7c934a11e2b2b3744014e328e306bb73 (diff) | |
tests/indent: demonstrate token repetition after line-end comment
| -rw-r--r-- | tests/usr.bin/indent/comment-line-end.0 | 9 | ||||
| -rw-r--r-- | tests/usr.bin/indent/comment-line-end.0.stdout | 11 | ||||
| -rwxr-xr-x | tests/usr.bin/indent/t_indent.sh | 6 |
3 files changed, 21 insertions, 5 deletions
diff --git a/tests/usr.bin/indent/comment-line-end.0 b/tests/usr.bin/indent/comment-line-end.0 index ba2c2ccf2f8..92b78fb6163 100644 --- a/tests/usr.bin/indent/comment-line-end.0 +++ b/tests/usr.bin/indent/comment-line-end.0 @@ -1,4 +1,4 @@ -/* $NetBSD: comment-line-end.0,v 1.5 2021/03/12 18:28:07 rillig Exp $ */ +/* $NetBSD: comment-line-end.0,v 1.6 2021/09/24 06:30:02 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -27,4 +27,11 @@ main(void) { } +/* FIXME: in the formatted output, the word 'bar' is repeated. */ +void c99_comment(void) +{ +foo(); // C++ comment +bar(); +} + // end-of-line comment at the end of the file diff --git a/tests/usr.bin/indent/comment-line-end.0.stdout b/tests/usr.bin/indent/comment-line-end.0.stdout index e6135487488..35a683b9953 100644 --- a/tests/usr.bin/indent/comment-line-end.0.stdout +++ b/tests/usr.bin/indent/comment-line-end.0.stdout @@ -1,4 +1,4 @@ -/* $NetBSD: comment-line-end.0.stdout,v 1.5 2021/03/12 18:28:07 rillig Exp $ */ +/* $NetBSD: comment-line-end.0.stdout,v 1.6 2021/09/24 06:30:02 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -30,5 +30,14 @@ main(void) { } +/* FIXME: in the formatted output, the word 'bar' is repeated. */ +void +c99_comment(void) +{ + foo(); // C++ comment +bar bar(); +} + // end-of-line comment at the end of the file +/* $ FIXME: the extra empty line above this line is wrong. */ diff --git a/tests/usr.bin/indent/t_indent.sh b/tests/usr.bin/indent/t_indent.sh index bd8c48ad6b0..ccddb2baea6 100755 --- a/tests/usr.bin/indent/t_indent.sh +++ b/tests/usr.bin/indent/t_indent.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $NetBSD: t_indent.sh,v 1.4 2021/03/08 22:13:05 rillig Exp $ +# $NetBSD: t_indent.sh,v 1.5 2021/09/24 06:30:02 rillig Exp $ # # Copyright 2016 Dell EMC # All rights reserved. @@ -40,8 +40,8 @@ check() # to pass. atf_check cp ${SRCDIR}/${tc}* . - # Remove single-line comments that start with '$'. This removes RCS - # IDs, preventing them to be broken into several lines. It also + # Remove single-line block comments that start with '$'. This removes + # RCS IDs, preventing them to be broken into several lines. It also # allows for remarks that are only needed in either the input or the # output. These removals affect the line numbers in the diffs. for fname in "$tc" "$tc.stdout" "$tc.stderr"; do |
