From 714b4970ad28026c6719fef358c9a124c4bf403c Mon Sep 17 00:00:00 2001
From: Per Cederqvist <ceder@lysator.liu.se>
Date: Mon, 6 Oct 2003 07:26:31 +0000
Subject: [PATCH] (Top level): Improve the test code.

---
 ChangeLog     |  3 +++
 pcl_expect.py | 11 +++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index af4245d..01b6732 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2003-10-06  Per Cederqvist  <ceder@ceder.dyndns.org>
 
+	Improve the test code.
+	* pcl_expect.py (Top level): Improve the test code.
+
 	Who can refuse the Inspiration?  The impl, expectable and popen
 	classes seems to work now.
 	* pcl_expect.py (expectable.__init__): New argument: fileno.
diff --git a/pcl_expect.py b/pcl_expect.py
index bff35fe..e53afb3 100644
--- a/pcl_expect.py
+++ b/pcl_expect.py
@@ -255,19 +255,22 @@ if __name__ == '__main__':
 
     x = impl()
     while x.loop():
-        if x.re(df, "^/.* .*\n"):
+        if x.re(df, "^/.* .*(?=\n)"):
             print "Normal line:", df.match.group()
             x.cont()
             continue
-        elif x.re(df, "^/.*\n"):
+        elif x.re(df, "^/.*(?=\n)"):
             print "Mount point only:", df.match.group()
             x.cont()
             continue
-        elif x.re(df, "^ .*\n"):
+        elif x.re(df, "^ .*(?=\n)"):
             print "Info only:", df.match.group()
             x.cont()
             continue
-        elif x.re(df, "^.*\n"):
+        elif x.re(df, "^\n"):
+            x.cont()
+            continue
+        elif x.re(df, "^.*(?=\n)"):
             print "Unexpected line", df.match.group()
             x.cont()
             continue
-- 
GitLab