MCPcopy Index your code
hub / github.com/github/git-sizer / TestFromSubdir

Function TestFromSubdir

git_sizer_test.go:646–666  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

644}
645
646func TestFromSubdir(t *testing.T) {
647 t.Parallel()
648
649 repo := testutils.NewTestRepo(t, false, "subdir")
650 defer repo.Remove(t)
651
652 timestamp := time.Unix(1112911993, 0)
653
654 repo.AddFile(t, "subdir/file.txt", "Hello, world!\n")
655
656 cmd := repo.GitCommand(t, "commit", "-m", "initial")
657 testutils.AddAuthorInfo(cmd, &timestamp)
658 require.NoError(t, cmd.Run(), "creating commit")
659
660 h, err := sizes.ScanRepositoryUsingGraph(
661 repo.Repository(t),
662 refGrouper{}, sizes.NameStyleNone, meter.NoProgressMeter,
663 )
664 require.NoError(t, err, "scanning repository")
665 assert.Equal(t, counts.Count32(2), h.MaxPathDepth, "max path depth")
666}
667
668func TestSubmodule(t *testing.T) {
669 t.Parallel()

Callers

nothing calls this directly

Calls 9

RemoveMethod · 0.95
AddFileMethod · 0.95
GitCommandMethod · 0.95
RepositoryMethod · 0.95
NewTestRepoFunction · 0.92
AddAuthorInfoFunction · 0.92
ScanRepositoryUsingGraphFunction · 0.92
Count32TypeAlias · 0.92
RunMethod · 0.80

Tested by

no test coverage detected