From 128cad81923ca8ee6f04e0f2eb1e9669790f0539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Can=20Bak=C4=B1r?= Date: Wed, 11 Oct 2023 09:58:09 +0000 Subject: [PATCH] fix tests --- inputs_test.go | 5 +++-- mutator_test.go | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/inputs_test.go b/inputs_test.go index 56277105..98d853a1 100644 --- a/inputs_test.go +++ b/inputs_test.go @@ -62,9 +62,10 @@ func TestExtractVar(t *testing.T) { }{ {statement: "{{sub}}.something.{{tld}}", expected: []string{"sub", "tld"}}, {statement: "{{sub}}.{{sub1}}.{{sub2}}.{{root}}", expected: []string{"sub", "sub1", "sub2", "root"}}, - {statement: "no variables", expected: []string{}}, + {statement: "no variables", expected: nil}, } for _, v := range testcases { - require.Equal(t, v.expected, getAllVars(v.statement)) + actual := getAllVars(v.statement) + require.Equal(t, v.expected, actual) } } diff --git a/mutator_test.go b/mutator_test.go index b62fb44c..4471457d 100644 --- a/mutator_test.go +++ b/mutator_test.go @@ -2,6 +2,7 @@ package alterx import ( "bytes" + "math" "strings" "testing" @@ -39,6 +40,7 @@ func TestMutatorResults(t *testing.T) { } opts.Patterns = testConfig.Patterns opts.Payloads = testConfig.Payloads + opts.MaxSize = math.MaxInt m, err := New(opts) require.Nil(t, err) var buff bytes.Buffer