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 lenient option parsing
details: https://anonhg.NetBSD.org/src/rev/5b1e4ce148fe
branches: trunk
changeset: 991108:5b1e4ce148fe
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Nov 07 15:54:00 2021 +0000
description:
tests/indent: test lenient option parsing
diffstat:
tests/usr.bin/indent/t_errors.sh | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diffs (54 lines):
diff -r fd95a4afc8ff -r 5b1e4ce148fe tests/usr.bin/indent/t_errors.sh
--- a/tests/usr.bin/indent/t_errors.sh Sun Nov 07 15:46:20 2021 +0000
+++ b/tests/usr.bin/indent/t_errors.sh Sun Nov 07 15:54:00 2021 +0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# $NetBSD: t_errors.sh,v 1.18 2021/11/07 10:42:58 rillig Exp $
+# $NetBSD: t_errors.sh,v 1.19 2021/11/07 15:54:00 rillig Exp $
#
# Copyright (c) 2021 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -143,6 +143,33 @@
-cli3garbage
}
+atf_test_case 'option_npro_trailing_garbage'
+option_npro_trailing_garbage_body()
+{
+ # TODO: reject -npro-garbage, only allow -npro without trailing garbage.
+
+ atf_check \
+ "$indent" -npro-garbage
+}
+
+atf_test_case 'option_st_trailing_garbage'
+option_st_trailing_garbage_body()
+{
+ # TODO: reject -stdio, only allow -st without trailing garbage.
+
+ atf_check \
+ "$indent" -stdio
+}
+
+atf_test_case 'option_version_trailing_garbage'
+option_version_trailing_garbage_body()
+{
+ # TODO: reject --version-dump, only allow --version without trailing garbage.
+
+ atf_check -o 'inline:NetBSD indent 2.1'"$nl" \
+ "$indent" --version-dump
+}
+
atf_test_case 'option_buffer_overflow'
option_buffer_overflow_body()
{
@@ -489,6 +516,9 @@
atf_add_test_case 'option_tabsize_very_large'
atf_add_test_case 'option_int_trailing_garbage'
atf_add_test_case 'option_cli_trailing_garbage'
+ atf_add_test_case 'option_npro_trailing_garbage'
+ atf_add_test_case 'option_st_trailing_garbage'
+ atf_add_test_case 'option_version_trailing_garbage'
atf_add_test_case 'option_indent_size_zero'
atf_add_test_case 'unterminated_comment_wrap'
atf_add_test_case 'unterminated_comment_nowrap'
Home |
Main Index |
Thread Index |
Old Index