Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/xlint/lint2 tests/lint: demonstrate bad error ...



details:   https://anonhg.NetBSD.org/src/rev/968cc4567c8e
branches:  trunk
changeset: 1027697:968cc4567c8e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Dec 16 03:44:48 2021 +0000

description:
tests/lint: demonstrate bad error message on missing newline

diffstat:

 tests/usr.bin/xlint/lint2/t_lint2.sh |  19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diffs (38 lines):

diff -r 57256b2a7af0 -r 968cc4567c8e tests/usr.bin/xlint/lint2/t_lint2.sh
--- a/tests/usr.bin/xlint/lint2/t_lint2.sh      Wed Dec 15 22:02:30 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/t_lint2.sh      Thu Dec 16 03:44:48 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_lint2.sh,v 1.10 2021/11/28 09:16:46 rillig Exp $
+# $NetBSD: t_lint2.sh,v 1.11 2021/12/16 03:44:48 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -175,6 +175,22 @@
        test_error_ignored '0u0.0x3var_'
 }
 
+missing_newline_head()
+{
+       std_head
+}
+
+missing_newline_body()
+{
+       printf '1d1.1e5func' > 'input.ln'
+
+       # FIXME: The error message is not understandable.
+       # FIXME: The line number is off by one.
+       atf_check -s 'exit:1' \
+           -e 'match:^.*: error: input\.ln:0: c \(for .1d1\.1e5func.\)$' \
+           "$lint2" 'input.ln'
+}
+
 atf_init_test_cases()
 {
        local i
@@ -200,4 +216,5 @@
        done
 
        atf_add_test_case 'error_cases'
+       atf_add_test_case 'missing_newline'
 }



Home | Main Index | Thread Index | Old Index