nuclei/pkg/utils/utils_test.go
Tarun Koyalwar dc44105baf
nuclei v3 : misc updates (#4247)
* use parsed options while signing

* update project layout to v3

* fix .gitignore

* remove example template

* misc updates

* bump tlsx version

* hide template sig warning with env

* js: retain value while using log

* fix nil pointer derefernce

* misc doc update

---------

Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
2023-10-17 17:44:13 +05:30

22 lines
456 B
Go

package utils
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
func TestUnwrapError(t *testing.T) {
require.Equal(t, nil, UnwrapError(nil))
errOne := fmt.Errorf("error one")
require.Equal(t, errOne, UnwrapError(errOne))
errTwo := fmt.Errorf("error with error: %w", errOne)
require.Equal(t, errOne, UnwrapError(errTwo))
errThree := fmt.Errorf("error with error: %w", errTwo)
require.Equal(t, errOne, UnwrapError(errThree))
}