Skip to content

Commit

Permalink
Add test case for Must helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
satori committed Jan 3, 2018
1 parent f692024 commit 36e9d2e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package uuid

import (
"bytes"
"fmt"
"testing"

. "gopkg.in/check.v1"
Expand Down Expand Up @@ -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")
}())
}

0 comments on commit 36e9d2e

Please sign in to comment.