Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/utils/utils_test.go
2070 views
1
package utils
2
3
import (
4
"fmt"
5
"testing"
6
7
"github.com/stretchr/testify/require"
8
)
9
10
func TestUnwrapError(t *testing.T) {
11
require.Equal(t, nil, UnwrapError(nil))
12
13
errOne := fmt.Errorf("error one")
14
require.Equal(t, errOne, UnwrapError(errOne))
15
16
errTwo := fmt.Errorf("error with error: %w", errOne)
17
require.Equal(t, errOne, UnwrapError(errTwo))
18
19
errThree := fmt.Errorf("error with error: %w", errTwo)
20
require.Equal(t, errOne, UnwrapError(errThree))
21
}
22
23