Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/atf/dist/atf-sh Pull up revision c917871de7dd67...



details:   https://anonhg.NetBSD.org/src/rev/203274e7ae86
branches:  trunk
changeset: 759354:203274e7ae86
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Mon Dec 06 18:04:02 2010 +0000

description:
Pull up revision c917871de7dd67ba57c17496ad68fe4e4aa8b239:

Fix atf-check match checker to validate lines without newline

Problem found by pooka@.

diffstat:

 external/bsd/atf/dist/atf-sh/atf-check.cpp     |  2 +-
 external/bsd/atf/dist/atf-sh/atf-check_test.sh |  2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r d2566b934563 -r 203274e7ae86 external/bsd/atf/dist/atf-sh/atf-check.cpp
--- a/external/bsd/atf/dist/atf-sh/atf-check.cpp        Mon Dec 06 17:30:07 2010 +0000
+++ b/external/bsd/atf/dist/atf-sh/atf-check.cpp        Mon Dec 06 18:04:02 2010 +0000
@@ -378,7 +378,7 @@
     bool found = false;
 
     std::string line;
-    while (!found && std::getline(stream, line).good()) {
+    while (!found && !std::getline(stream, line).fail()) {
         if (atf::text::match(line, regexp))
             found = true;
     }
diff -r d2566b934563 -r 203274e7ae86 external/bsd/atf/dist/atf-sh/atf-check_test.sh
--- a/external/bsd/atf/dist/atf-sh/atf-check_test.sh    Mon Dec 06 17:30:07 2010 +0000
+++ b/external/bsd/atf/dist/atf-sh/atf-check_test.sh    Mon Dec 06 18:04:02 2010 +0000
@@ -234,6 +234,7 @@
 }
 oflag_match_body()
 {
+    h_pass "printf no-newline" -o "match:^no-newline"
     h_pass "echo line1; echo foo bar" -o "match:^foo"
     h_pass "echo foo bar" -o "match:o b"
     h_fail "echo foo bar" -o "match:baz"
@@ -365,6 +366,7 @@
 }
 eflag_match_body()
 {
+    h_pass "printf no-newline 1>&2" -e "match:^no-newline"
     h_pass "echo line1 1>&2; echo foo bar 1>&2" -e "match:^foo"
     h_pass "echo foo bar 1>&2" -e "match:o b"
     h_fail "echo foo bar 1>&2" -e "match:baz"



Home | Main Index | Thread Index | Old Index