Module Name: src
Committed By: rillig
Date: Sun Nov 7 15:01:50 UTC 2021
Modified Files:
src/tests/usr.bin/indent: t_misc.sh
Log Message:
tests/indent: test options without '-' in profile files
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/indent/t_misc.sh
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/t_misc.sh
diff -u src/tests/usr.bin/indent/t_misc.sh:1.12 src/tests/usr.bin/indent/t_misc.sh:1.13
--- src/tests/usr.bin/indent/t_misc.sh:1.12 Sat Oct 30 09:32:46 2021
+++ src/tests/usr.bin/indent/t_misc.sh Sun Nov 7 15:01:50 2021
@@ -1,5 +1,5 @@
#! /bin/sh
-# $NetBSD: t_misc.sh,v 1.12 2021/10/30 09:32:46 rillig Exp $
+# $NetBSD: t_misc.sh,v 1.13 2021/11/07 15:01:50 rillig Exp $
#
# Copyright (c) 2021 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -190,6 +190,21 @@ option_P_in_profile_file_body()
"$indent" < code.c
}
+atf_test_case 'option_without_hyphen'
+option_without_hyphen_body()
+{
+ # TODO: Options in profile files should be required to start with
+ # '-', just like in the command line arguments.
+
+ printf ' -i3 xi5 +di0\n' > .indent.pro
+
+ printf '%s\n' 'int var[] = {' '1,' '}' > code.c
+ printf '%s\n' 'int var[] = {' ' 1,' '}' > code.exp
+
+ atf_check -o 'file:code.exp' \
+ "$indent" < code.c
+}
+
atf_test_case 'opt'
opt_body()
{
@@ -355,6 +370,7 @@ atf_init_test_cases()
atf_add_test_case 'verbose_profile'
atf_add_test_case 'nested_struct_declarations'
atf_add_test_case 'option_P_in_profile_file'
+ atf_add_test_case 'option_without_hyphen'
atf_add_test_case 'opt'
atf_add_test_case 'opt_npro'
atf_add_test_case 'opt_U'