github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/charmhub/path/package_test.go (about) 1 // Copyright 2020 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package path 5 6 import ( 7 "net/url" 8 "testing" 9 10 jc "github.com/juju/testing/checkers" 11 gc "gopkg.in/check.v1" 12 ) 13 14 func Test(t *testing.T) { 15 gc.TestingT(t) 16 } 17 18 func MustParseURL(c *gc.C, path string) *url.URL { 19 u, err := url.Parse(path) 20 c.Assert(err, jc.ErrorIsNil) 21 return u 22 } 23 24 func MustMakePath(c *gc.C, path string) Path { 25 u := MustParseURL(c, path) 26 return MakePath(u) 27 }