From 9e868736cf252fc0e2cb09a6dd843de09bfa8aea Mon Sep 17 00:00:00 2001 From: aaron <462826@qq.com> Date: Thu, 4 Jun 2020 11:07:51 +0800 Subject: [PATCH] fix issue cased by expect file is empty line --- demo/sample/1_simple.php | 2 +- src/service/testing/ztfCheck.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/sample/1_simple.php b/demo/sample/1_simple.php index 1632deb4..ac616b6e 100755 --- a/demo/sample/1_simple.php +++ b/demo/sample/1_simple.php @@ -14,7 +14,7 @@ pid=0 [esac] */ -checkStep1() || print(">> expect 1\n"); +checkStep1() || print(">> - expect 1\n"); checkStep3() || print(">> expect 3\n"); function checkStep1(){} diff --git a/src/service/testing/ztfCheck.go b/src/service/testing/ztfCheck.go index 62bf5e11..53893d0f 100644 --- a/src/service/testing/ztfCheck.go +++ b/src/service/testing/ztfCheck.go @@ -118,7 +118,7 @@ func ValidateStepResult(langType string, expectLines []string, actualLines []str expect = expect[1:len(expect) - 1] pass = stringUtils.MatchString(expect, log, langType) } else { - pass = strings.Contains(expect, log) + pass = strings.Contains(log, expect) } if !pass { -- GitLab