Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane committed Jan 16, 2025
1 parent 47450c9 commit b0697bb
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions private/buf/buffetch/ref_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"path/to/dir.git",
)
Expand All @@ -270,6 +271,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
40,
"",
"",
),
"path/to/dir.git#depth=40",
)
Expand All @@ -283,6 +285,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"path/to/dir.git#branch=main",
)
Expand All @@ -296,6 +299,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"file:///path/to/dir.git#branch=main",
)
Expand All @@ -309,6 +313,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"path/to/dir.git#tag=v1.0.0",
)
Expand All @@ -322,6 +327,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"http://hello.com/path/to/dir.git#branch=main",
)
Expand All @@ -335,6 +341,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"https://hello.com/path/to/dir.git#branch=main",
)
Expand All @@ -348,6 +355,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"ssh://[email protected]:path/to/dir.git#branch=main",
)
Expand All @@ -361,6 +369,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
50,
"",
"",
),
"ssh://[email protected]:path/to/dir.git#ref=refs/remotes/origin/HEAD",
)
Expand All @@ -374,6 +383,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
50,
"",
"",
),
"ssh://[email protected]:path/to/dir.git#ref=refs/remotes/origin/HEAD,branch=main",
)
Expand All @@ -387,6 +397,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
10,
"",
"",
),
"ssh://[email protected]:path/to/dir.git#ref=refs/remotes/origin/HEAD,depth=10",
)
Expand All @@ -400,6 +411,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
10,
"",
"",
),
"ssh://[email protected]:path/to/dir.git#ref=refs/remotes/origin/HEAD,branch=main,depth=10",
)
Expand All @@ -413,6 +425,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"foo/bar",
"",
),
"path/to/dir.git#subdir=foo/bar",
)
Expand All @@ -426,6 +439,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"path/to/dir.git#subdir=.",
)
Expand All @@ -439,6 +453,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"path/to/dir.git#subdir=foo/..",
)
Expand All @@ -452,6 +467,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"git://[email protected]:path/to/dir.git#branch=main",
)
Expand All @@ -465,9 +481,24 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"git://path/to/dir.git#branch=main",
)
testGetParsedRefSuccess(
t,
internal.NewDirectParsedGitRef(
formatGit,
"path/to/dir.git",
internal.GitSchemeGit,
git.NewBranchName("main"),
false,
1,
"subdir",
"tree:0",
),
"git://path/to/dir.git#branch=main,filter=tree:0,subdir=subdir",
)
testGetParsedRefSuccess(
t,
internal.NewDirectParsedSingleRef(
Expand Down Expand Up @@ -811,6 +842,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"/path/to/dir#branch=main,format=git",
)
Expand All @@ -824,6 +856,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"/path/to/dir#format=git,branch=main/foo",
)
Expand All @@ -837,6 +870,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"path/to/dir#tag=main/foo,format=git",
)
Expand All @@ -850,6 +884,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"path/to/dir#format=git,tag=main/foo",
)
Expand All @@ -863,6 +898,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
true,
1,
"",
"",
),
"path/to/dir#format=git,tag=main/foo,recurse_submodules=true",
)
Expand All @@ -876,6 +912,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
1,
"",
"",
),
"path/to/dir#format=git,tag=main/foo,recurse_submodules=false",
)
Expand All @@ -889,6 +926,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
50,
"",
"",
),
"path/to/dir#format=git,ref=refs/remotes/origin/HEAD",
)
Expand All @@ -902,6 +940,7 @@ func TestGetParsedRefSuccess(t *testing.T) {
false,
10,
"",
"",
),
"path/to/dir#format=git,ref=refs/remotes/origin/HEAD,depth=10",
)
Expand Down

0 comments on commit b0697bb

Please sign in to comment.