From 45efaa2088b401c8c8aff7a65d066357649f3bf7 Mon Sep 17 00:00:00 2001 From: Jonathan Cran Date: Tue, 28 Dec 2010 19:50:44 +0000 Subject: [PATCH] small changes, making testing of msfconsole output easier git-svn-id: file:///home/svn/framework3/trunk@11435 4d416f70-5f16-0410-b530-b9f4589650da --- test/lib/regexr.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/lib/regexr.rb b/test/lib/regexr.rb index 9ae34d358f..5d1b85202f 100644 --- a/test/lib/regexr.rb +++ b/test/lib/regexr.rb @@ -104,6 +104,9 @@ class Regexr re = Regexp.new(condition, @case_insensitive) data_lines.each {|line| if line =~ re + if @verbose + puts "DEBUG: matched success: " + line + end success_count += 1 matched = true break @@ -120,14 +123,15 @@ class Regexr } if target_successes == success_count - if @verbose - puts "DEBUG: woot, got all successes" + if @verbose + puts "DEBUG: Woot, got all successes" end return true else if @verbose - puts "DEBUG: Didn't get enough successes, somehow. (" + count + "/" + target_successes + ")" + puts "DEBUG: Didn't get enough successes, failing. (" + count + "/" + target_successes + ")" end + return false end else return true # No successes are defined, so count this as a pass (true). @@ -151,7 +155,7 @@ class Regexr okay = false # oh, we found a match if @verbose - puts "found " + line + puts "DEBUG: Matched failure: " + line end @@ -162,7 +166,7 @@ class Regexr # If the exception matches here, we'll spare it if reg_exception =~ line if @verbose - puts "\'" + line + "\' is an exception, we can ignore it." + puts "DEBUG: but \'" + line + "\' is an exception, we can ignore it." end okay = true break