Skip to content

Commit 8134964

Browse files
Add tests for submodule depth values
1 parent 5c59408 commit 8134964

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

options/options_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,23 @@ func TestEnvOptionParsing(t *testing.T) {
8686
require.Equal(t, o.BinaryPath, val)
8787
})
8888

89-
t.Run("git clone submodules", func(t *testing.T) {
89+
t.Run("git clone submodules true", func(t *testing.T) {
9090
t.Setenv(options.WithEnvPrefix("GIT_CLONE_SUBMODULES"), "true")
9191
o := runCLI()
9292
require.Equal(t, 10, o.GitCloneSubmodules) // "true" defaults to depth 10
9393
})
94+
95+
t.Run("git clone submodules depth", func(t *testing.T) {
96+
t.Setenv(options.WithEnvPrefix("GIT_CLONE_SUBMODULES"), "3")
97+
o := runCLI()
98+
require.Equal(t, 3, o.GitCloneSubmodules)
99+
})
100+
101+
t.Run("git clone submodules false", func(t *testing.T) {
102+
t.Setenv(options.WithEnvPrefix("GIT_CLONE_SUBMODULES"), "false")
103+
o := runCLI()
104+
require.Equal(t, 0, o.GitCloneSubmodules)
105+
})
94106
})
95107
}
96108

0 commit comments

Comments
 (0)