diff options
author | Toon Claes <toon@gitlab.com> | 2022-01-26 17:06:56 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2022-01-26 17:12:54 +0300 |
commit | 3dbda28aaba205330f05c7eb852230330dce76c4 (patch) | |
tree | 548cc8721352b555d6ce5fc740d6a6f536877657 | |
parent | 661ed720e15f3d71d92ae2e04cba4399c4dc19e8 (diff) |
linguist: Add test to successful get Stats
There was no test yet that tests the successful parsing of the language
stats on a repo. This change adds such test.
-rw-r--r-- | internal/gitaly/linguist/linguist_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/gitaly/linguist/linguist_test.go b/internal/gitaly/linguist/linguist_test.go index ca59a328c..93e690b02 100644 --- a/internal/gitaly/linguist/linguist_test.go +++ b/internal/gitaly/linguist/linguist_test.go @@ -16,6 +16,20 @@ func TestMain(m *testing.M) { testhelper.Run(m) } +func TestInstance_Stats_successful(t *testing.T) { + ctx, cancel := testhelper.Context() + defer cancel() + + cfg, _, repoPath := testcfg.BuildWithRepo(t) + + ling, err := New(cfg, gittest.NewCommandFactory(t, cfg)) + require.NoError(t, err) + + counts, err := ling.Stats(ctx, repoPath, "1e292f8fedd741b75372e19097c76d327140c312") + require.NoError(t, err) + require.Equal(t, uint64(2943), counts["Ruby"]) +} + func TestInstance_Stats_unmarshalJSONError(t *testing.T) { cfg := testcfg.Build(t) |