automake-patches
[Top][All Lists]
Advanced

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

[FYI 0/2] {test-protocols} Correctly handle the string "0" in TAP messag


From: Stefano Lattarini
Subject: [FYI 0/2] {test-protocols} Correctly handle the string "0" in TAP messages.
Date: Wed, 17 Aug 2011 19:12:25 +0200

Perl makes basically no distinction between the string "0" and the number 0:
 $ perl -e '$x = 0; $y = "0"; print "Ouch\n" if $x == $y && $x eq $y && !$y;'
 Ouch
In particular, this means that the string "0" is considered as a false value
when used as a boolean.  This "feature" was causing some problems in our
TAP driver, when, say, a test description or a "Bail out!" message consisted
only of a literal "0" -- in this case the driver acted as if the message was
not there at all.  While this is clearly a pretty extreme corner case, it's
nice to handle it correctly nonetheless.  The first patch fixes the problem,
and the second one improves the testsuite coverage (and makes it more
granular).

Stefano Lattarini (2):
  tap: correctly handle string "0" in TAP messages
  tap: improve granularity for tests on problematic TAP messages

 ChangeLog                                          |   24 +++++++
 lib/tap-driver.pl                                  |   32 ++++++---
 tests/Makefile.am                                  |    7 ++-
 tests/Makefile.in                                  |    8 ++-
 .../{tap-message-0.test => tap-msg0-bailout.test}  |   44 ++----------
 ...{tap-message-0.test => tap-msg0-directive.test} |   45 +++----------
 tests/{tap-message-0.test => tap-msg0-misc.test}   |   68 ++++++++++++--------
 tests/tap-msg0-planskip.test                       |   37 +++++++++++
 tests/{tap-message-0.test => tap-msg0-result.test} |   37 +++++------
 9 files changed, 170 insertions(+), 132 deletions(-)
 copy tests/{tap-message-0.test => tap-msg0-bailout.test} (50%)
 copy tests/{tap-message-0.test => tap-msg0-directive.test} (51%)
 copy tests/{tap-message-0.test => tap-msg0-misc.test} (51%)
 create mode 100755 tests/tap-msg0-planskip.test
 rename tests/{tap-message-0.test => tap-msg0-result.test} (62%)

-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]