forked from mirror/go.uuid
Add test case for Must helper.
This commit is contained in:
parent
f6920249aa
commit
36e9d2ebbd
10
uuid_test.go
10
uuid_test.go
|
@ -23,6 +23,7 @@ package uuid
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
. "gopkg.in/check.v1"
|
||||
|
@ -88,3 +89,12 @@ func (s *testSuite) TestSetVariant(c *C) {
|
|||
u.SetVariant(VariantFuture)
|
||||
c.Assert(u.Variant(), Equals, VariantFuture)
|
||||
}
|
||||
|
||||
func (s *testSuite) TestMust(c *C) {
|
||||
defer func() {
|
||||
c.Assert(recover(), NotNil)
|
||||
}()
|
||||
Must(func() (UUID, error) {
|
||||
return Nil, fmt.Errorf("uuid: expected error")
|
||||
}())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue