From 4344da9007ea74b3644e72e8c14262d1fab05897 Mon Sep 17 00:00:00 2001 From: M09Ic Date: Fri, 11 Nov 2022 01:13:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96pool.compare=E9=80=BB?= =?UTF-8?q?=E8=BE=91,=20=E5=87=8F=E5=B0=91=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E7=9A=84fuzzy=20compare?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/pool.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/pool.go b/internal/pool.go index e8bc4d4..b38aff6 100644 --- a/internal/pool.go +++ b/internal/pool.go @@ -267,11 +267,14 @@ Loop: p.outputCh <- bl continue } - - if base, ok := p.baselines[bl.Status]; ok && base.Compare(bl) == 1 { + var status int + base, ok := p.baselines[bl.Status] + if ok { // 挑选对应状态码的baseline进行compare - p.PutToInvalid(bl, "compare failed") - continue + if status = base.Compare(bl); status == 1 { + p.PutToInvalid(bl, "compare failed") + continue + } } bl.Collect() @@ -282,7 +285,7 @@ Loop: } } - if base, ok := p.baselines[bl.Status]; ok && base.FuzzyCompare(bl) { + if status == 0 && ok && base.FuzzyCompare(bl) { p.PutToInvalid(bl, "fuzzy compare failed") p.PutToFuzzy(bl) continue