summaryrefslogtreecommitdiff
path: root/tests/usr.bin
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2023-05-13 16:40:18 +0000
committerrillig <rillig@NetBSD.org>2023-05-13 16:40:18 +0000
commitdea05ab97143498297dc889fc6e18d8e38239bcc (patch)
tree62322d252bd360a3e9376405dda46a832beae4b2 /tests/usr.bin
parent4435f37ebe57895abd614114158b08b2b7a88664 (diff)
indent: do not add a space before a comment that starts a line
Diffstat (limited to 'tests/usr.bin')
-rw-r--r--tests/usr.bin/indent/lsym_comment.c10
-rw-r--r--tests/usr.bin/indent/opt_fc1.c8
-rw-r--r--tests/usr.bin/indent/t_errors.sh16
3 files changed, 17 insertions, 17 deletions
diff --git a/tests/usr.bin/indent/lsym_comment.c b/tests/usr.bin/indent/lsym_comment.c
index 8b334a54762..92f707a153b 100644
--- a/tests/usr.bin/indent/lsym_comment.c
+++ b/tests/usr.bin/indent/lsym_comment.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_comment.c,v 1.6 2023/05/13 06:52:48 rillig Exp $ */
+/* $NetBSD: lsym_comment.c,v 1.7 2023/05/13 16:40:18 rillig Exp $ */
/*
* Tests for the token lsym_comment, which starts a comment.
@@ -732,8 +732,8 @@ loop(void)
while (cond) /* comment */ ;
while (cond)
-/* $ XXX: The spaces around the comment look unintentional. */
- /* comment */ ;
+/* $ XXX: The space after the comment looks unintentional. */
+ /* comment */ ;
}
//indent end
@@ -940,7 +940,7 @@ f(void)
/*
* 12 1234 123 123456 1234 1234567 123
* 1234.
- */ ;
+ */ ;
}
//indent end
@@ -950,7 +950,7 @@ int
f(void)
{
if (0)
- /* 12 1234 123 123456 1234 1234567 123 1234. */ ;
+ /* 12 1234 123 123456 1234 1234567 123 1234. */ ;
}
//indent end
diff --git a/tests/usr.bin/indent/opt_fc1.c b/tests/usr.bin/indent/opt_fc1.c
index 03b4786d0ab..13ad7b6a69a 100644
--- a/tests/usr.bin/indent/opt_fc1.c
+++ b/tests/usr.bin/indent/opt_fc1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_fc1.c,v 1.8 2022/04/24 09:04:12 rillig Exp $ */
+/* $NetBSD: opt_fc1.c,v 1.9 2023/05/13 16:40:18 rillig Exp $ */
/*
* Tests for the options '-fc1' and '-nfc1'.
@@ -135,9 +135,9 @@
//indent end
//indent run -fc1
- /* comment */ int decl2; /* comment */
- /* looooooooooooooooooooooooooooooooooooooooong first comment */ int decl2; /* second comment */
- /* first comment */ int decl2; /* looooooooooooooooooooooooooooooooooooooooong
+/* comment */ int decl2; /* comment */
+/* looooooooooooooooooooooooooooooooooooooooong first comment */ int decl2; /* second comment */
+/* first comment */ int decl2; /* looooooooooooooooooooooooooooooooooooooooong
* second comment */
//indent end
diff --git a/tests/usr.bin/indent/t_errors.sh b/tests/usr.bin/indent/t_errors.sh
index 58b4c0864fc..74a419e6485 100644
--- a/tests/usr.bin/indent/t_errors.sh
+++ b/tests/usr.bin/indent/t_errors.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# $NetBSD: t_errors.sh,v 1.26 2023/05/13 08:33:39 rillig Exp $
+# $NetBSD: t_errors.sh,v 1.27 2023/05/13 16:40:18 rillig Exp $
#
# Copyright (c) 2021 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -438,8 +438,8 @@ unbalanced_parentheses_3_body()
"$indent" code.c
}
-atf_test_case 'search_stmt_comment_segv'
-search_stmt_comment_segv_body()
+atf_test_case 'crash_comment_after_controlling_expression'
+crash_comment_after_controlling_expression_body()
{
# Before 2023-05-11, indent crashed while
# trying to format the following artificial code.
@@ -457,8 +457,8 @@ EOF
"$indent" code.c -st
}
-atf_test_case 'search_stmt_fits_in_one_line'
-search_stmt_fits_in_one_line_body()
+atf_test_case 'comment_fits_in_one_line'
+comment_fits_in_one_line_body()
{
# The comment is placed after 'if (0) ...', where it is processed
# by search_stmt_comment. That function redirects the input buffer to
@@ -482,7 +482,7 @@ f(void)
if (0)
/*
* 0123456789012345678901
- */ ;
+ */ ;
}
EOF
@@ -572,7 +572,7 @@ atf_init_test_cases()
atf_add_test_case 'unbalanced_parentheses_1'
atf_add_test_case 'unbalanced_parentheses_2'
atf_add_test_case 'unbalanced_parentheses_3'
- atf_add_test_case 'search_stmt_comment_segv'
- atf_add_test_case 'search_stmt_fits_in_one_line'
+ atf_add_test_case 'crash_comment_after_controlling_expression'
+ atf_add_test_case 'comment_fits_in_one_line'
atf_add_test_case 'compound_literal'
}