Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/indent tests/indent: test several options '-P'



details:   https://anonhg.NetBSD.org/src/rev/ad2c277a5946
branches:  trunk
changeset: 990545:ad2c277a5946
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 30 09:32:46 2021 +0000

description:
tests/indent: test several options '-P'

diffstat:

 tests/usr.bin/indent/t_misc.sh |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r fd180943a607 -r ad2c277a5946 tests/usr.bin/indent/t_misc.sh
--- a/tests/usr.bin/indent/t_misc.sh    Sat Oct 30 09:26:11 2021 +0000
+++ b/tests/usr.bin/indent/t_misc.sh    Sat Oct 30 09:32:46 2021 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_misc.sh,v 1.11 2021/10/29 19:22:55 rillig Exp $
+# $NetBSD: t_misc.sh,v 1.12 2021/10/30 09:32:46 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -335,6 +335,20 @@
            cat code.c.BAK
 }
 
+atf_test_case 'several_profiles'
+several_profiles_body()
+{
+       # If the option '-P' occurs several times, only the last of the
+       # profiles is loaded, the others are ignored.
+
+       echo ' --invalid-option' > error.pro
+       echo '' > last.pro
+       echo '' > code.c
+
+       atf_check \
+           "$indent" -Pnonexistent.pro -Perror.pro -Plast.pro code.c -st
+}
+
 atf_init_test_cases()
 {
        atf_add_test_case 'in_place'
@@ -346,4 +360,5 @@
        atf_add_test_case 'opt_U'
        atf_add_test_case 'line_no_counting'
        atf_add_test_case 'default_backup_extension'
+       atf_add_test_case 'several_profiles'
 }



Home | Main Index | Thread Index | Old Index