aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorAndrew Suffield <asuffield@gmail.com>2021-03-26 16:03:49 +0000
committerGitHub <noreply@github.com>2021-03-26 17:03:49 +0100
commite5bbc4d10904554dbc8fd5afd06f66814f7b173e (patch)
tree6a1508b51ede537c75896ba6650a8f5fb0ad09f8 /repository_test.go
parent1f328388192915476c68e5e0c8c1c818fd50fc6b (diff)
downloadgo-git-e5bbc4d10904554dbc8fd5afd06f66814f7b173e.tar.gz
plumbing: wire up contexts for Transport.AdvertisedReferences (#246)
* plumbing: wire up contexts for Transport.AdvertisedReferences * add more tests for context wiring
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/repository_test.go b/repository_test.go
index 7d4ddce..0239a2b 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -187,7 +187,7 @@ func (s *RepositorySuite) TestCloneContext(c *C) {
})
c.Assert(r, NotNil)
- c.Assert(err, ErrorMatches, ".* context canceled")
+ c.Assert(err, Equals, context.Canceled)
}
func (s *RepositorySuite) TestCloneWithTags(c *C) {
@@ -655,12 +655,12 @@ func (s *RepositorySuite) TestPlainCloneContextCancel(c *C) {
})
c.Assert(r, NotNil)
- c.Assert(err, ErrorMatches, ".* context canceled")
+ c.Assert(err, Equals, context.Canceled)
}
func (s *RepositorySuite) TestPlainCloneContextNonExistentWithExistentDir(c *C) {
ctx, cancel := context.WithCancel(context.Background())
- cancel()
+ defer cancel()
tmpDir := c.MkDir()
repoDir := tmpDir
@@ -681,7 +681,7 @@ func (s *RepositorySuite) TestPlainCloneContextNonExistentWithExistentDir(c *C)
func (s *RepositorySuite) TestPlainCloneContextNonExistentWithNonExistentDir(c *C) {
ctx, cancel := context.WithCancel(context.Background())
- cancel()
+ defer cancel()
tmpDir := c.MkDir()
repoDir := filepath.Join(tmpDir, "repoDir")
@@ -719,7 +719,7 @@ func (s *RepositorySuite) TestPlainCloneContextNonExistentWithNotDir(c *C) {
func (s *RepositorySuite) TestPlainCloneContextNonExistentWithNotEmptyDir(c *C) {
ctx, cancel := context.WithCancel(context.Background())
- cancel()
+ defer cancel()
tmpDir := c.MkDir()
repoDirPath := filepath.Join(tmpDir, "repoDir")
@@ -743,7 +743,7 @@ func (s *RepositorySuite) TestPlainCloneContextNonExistentWithNotEmptyDir(c *C)
func (s *RepositorySuite) TestPlainCloneContextNonExistingOverExistingGitDirectory(c *C) {
ctx, cancel := context.WithCancel(context.Background())
- cancel()
+ defer cancel()
tmpDir := c.MkDir()
r, err := PlainInit(tmpDir, false)