diff options
| author | Shulhan <m.shulhan@gmail.com> | 2020-09-02 02:30:46 +0700 |
|---|---|---|
| committer | Shulhan <m.shulhan@gmail.com> | 2020-09-02 02:30:46 +0700 |
| commit | 0ea29cef3402ed356f4798a8cf7517b6965d7bf7 (patch) | |
| tree | 468ba3864fd54386fee1e2ed3bbd6a3bcf9a1caf /cmd/resolverbench | |
| parent | caa995dad66a13723eeb5819eb0195e3b8ae828e (diff) | |
| download | rescached-0ea29cef3402ed356f4798a8cf7517b6965d7bf7.tar.xz | |
resolverbench: check all answers value before printing unmatched response
Diffstat (limited to 'cmd/resolverbench')
| -rw-r--r-- | cmd/resolverbench/main.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd/resolverbench/main.go b/cmd/resolverbench/main.go index ffa8e77..e042dec 100644 --- a/cmd/resolverbench/main.go +++ b/cmd/resolverbench/main.go @@ -45,9 +45,17 @@ func main() { } exp := rr.Value.(string) - got := res.Answer[0].Value.(string) + got := "" + found := false + for x := 0; x < len(res.Answer); x++ { + got = res.Answer[x].Value.(string) + if exp == got { + found = true + break + } + } - if exp != got { + if !found { nfail++ log.Printf(`! Answer not matched %s: expecting: %s |
