diff options
author | Antonio Jesus Navarro Perez <antnavper@gmail.com> | 2017-05-16 16:08:20 +0200 |
---|---|---|
committer | Antonio Jesus Navarro Perez <antnavper@gmail.com> | 2017-05-16 16:08:20 +0200 |
commit | 7e798fc34d703770e3391de8ecd65edea0d40181 (patch) | |
tree | f51f804ba5526e8990d0c1ce186e239667930600 /plumbing/transport/server/loader_test.go | |
parent | 681f24d65046397228b4e4bb4e248fdb1e27f347 (diff) | |
download | go-git-7e798fc34d703770e3391de8ecd65edea0d40181.tar.gz |
transport/server: use Endpoint string representation as a map key.
Two endpoints are not equals between them, even if they were generated using the same url or path.
Diffstat (limited to 'plumbing/transport/server/loader_test.go')
-rw-r--r-- | plumbing/transport/server/loader_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plumbing/transport/server/loader_test.go b/plumbing/transport/server/loader_test.go index 5f32cb0..38fabe3 100644 --- a/plumbing/transport/server/loader_test.go +++ b/plumbing/transport/server/loader_test.go @@ -5,6 +5,7 @@ import ( "path/filepath" "gopkg.in/src-d/go-git.v4/plumbing/transport" + "gopkg.in/src-d/go-git.v4/storage/memory" . "gopkg.in/check.v1" ) @@ -54,3 +55,18 @@ func (s *LoaderSuite) TestLoadIgnoreHost(c *C) { c.Assert(err, IsNil) c.Assert(sto, NotNil) } + +func (s *LoaderSuite) TestMapLoader(c *C) { + ep, err := transport.NewEndpoint("file://test") + sto := memory.NewStorage() + c.Assert(err, IsNil) + + loader := MapLoader{ep.String(): sto} + + ep, err = transport.NewEndpoint("file://test") + c.Assert(err, IsNil) + + loaderSto, err := loader.Load(ep) + c.Assert(err, IsNil) + c.Assert(sto, Equals, loaderSto) +} |