initial import
This commit is contained in:
21
core/errorx/atomicerror_test.go
Normal file
21
core/errorx/atomicerror_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package errorx
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var errDummy = errors.New("hello")
|
||||
|
||||
func TestAtomicError(t *testing.T) {
|
||||
var err AtomicError
|
||||
err.Set(errDummy)
|
||||
assert.Equal(t, errDummy, err.Load())
|
||||
}
|
||||
|
||||
func TestAtomicErrorNil(t *testing.T) {
|
||||
var err AtomicError
|
||||
assert.Nil(t, err.Load())
|
||||
}
|
||||
Reference in New Issue
Block a user