X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=tests%2Ftapview;fp=tests%2Ftapview;h=0a36f88cada4f0d6774051d4210217c0969bbdbe;hp=b96b4367972a7a0a10fb8bc40f55cfef388bd678;hb=3c09c25cc3343546143447547297d23201f2140c;hpb=f26514b5dd3624076f59801cfca66cc7cbdd3313 diff --git a/tests/tapview b/tests/tapview index b96b436..0a36f88 100755 --- a/tests/tapview +++ b/tests/tapview @@ -4,14 +4,15 @@ # This code is intended to be embedded in your project. The author # grants permission for it to be distributed under the prevailing # license of your project if you choose, provided that license is -# OSD-compliant; otherwise the following SPDX tag incorporates a -# license by reference. +# OSD-compliant; otherwise the following SPDX tag incorporates the +# MIT No Attribution license by reference. # -# SPDX-FileCopyrightText: Copyright Eric S. Raymond -# SPDX-License-Identifier: BSD-2-Clause +# SPDX-FileCopyrightText: (C) Eric S. Raymond +# SPDX-License-Identifier: MIT-0 # -# This is version 1.6 # A newer version may be available at https://gitlab.com/esr/tapview +# Check your last commit date for this file against the commit list +# there to see if it might be a good idea to update. # OK="." FAIL="F" @@ -19,13 +20,16 @@ SKIP="s" TODO_NOT_OK="x" TODO_OK="u" +LF=' +' + ship_char() { # shellcheck disable=SC2039 printf '%s' "$1" # https://www.etalabs.net/sh_tricks.html } ship_line() { - report="${report}${1}\n" + report="${report}${1}$LF" } ship_error() { @@ -34,7 +38,7 @@ ship_error() { then echo "" fi - report="${report}${1}\n" + report="${report}${1}$LF" echo "${report}" exit 1 } @@ -76,6 +80,10 @@ context_pop () { then ship_line "Expected $(context_get expect) tests but only ${testcount} ran." status=1 + elif [ "$(context_get plan)" != "" ] && [ "$(context_get expect)" -lt "$(context_get count)" ] + then + ship_line "${testcount} ran but $(context_get expect) expected." + status=1 fi }