MCPcopy Index your code
hub / github.com/git-bug/git-bug / testCases

Function testCases

bridge/gitlab/export_test.go:38–138  ·  view source on GitHub ↗
(t *testing.T, repo *cache.RepoCache)

Source from the content-addressed store, hash-verified

36}
37
38func testCases(t *testing.T, repo *cache.RepoCache) []*testCase {
39 // simple bug
40 simpleBug, _, err := repo.Bugs().New("simple bug", "new bug")
41 require.NoError(t, err)
42
43 // bug with comments
44 bugWithComments, _, err := repo.Bugs().New("bug with comments", "new bug")
45 require.NoError(t, err)
46
47 _, _, err = bugWithComments.AddComment("new comment")
48 require.NoError(t, err)
49
50 // bug with label changes
51 bugLabelChange, _, err := repo.Bugs().New("bug label change", "new bug")
52 require.NoError(t, err)
53
54 _, _, err = bugLabelChange.ChangeLabels([]string{"bug"}, nil)
55 require.NoError(t, err)
56
57 _, _, err = bugLabelChange.ChangeLabels([]string{"core"}, nil)
58 require.NoError(t, err)
59
60 _, _, err = bugLabelChange.ChangeLabels(nil, []string{"bug"})
61 require.NoError(t, err)
62
63 // bug with comments editions
64 bugWithCommentEditions, createOp, err := repo.Bugs().New("bug with comments editions", "new bug")
65 require.NoError(t, err)
66
67 _, err = bugWithCommentEditions.EditComment(
68 entity.CombineIds(bugWithCommentEditions.Id(), createOp.Id()), "first comment edited")
69 require.NoError(t, err)
70
71 commentId, _, err := bugWithCommentEditions.AddComment("first comment")
72 require.NoError(t, err)
73
74 _, err = bugWithCommentEditions.EditComment(commentId, "first comment edited")
75 require.NoError(t, err)
76
77 // bug status changed
78 bugStatusChanged, _, err := repo.Bugs().New("bug status changed", "new bug")
79 require.NoError(t, err)
80
81 _, err = bugStatusChanged.Close()
82 require.NoError(t, err)
83
84 _, err = bugStatusChanged.Open()
85 require.NoError(t, err)
86
87 // bug title changed
88 bugTitleEdited, _, err := repo.Bugs().New("bug title edited", "new bug")
89 require.NoError(t, err)
90
91 _, err = bugTitleEdited.SetTitle("bug title edited again")
92 require.NoError(t, err)
93
94 return []*testCase{
95 {

Callers 1

TestGitlabPushPullFunction · 0.70

Calls 10

CombineIdsFunction · 0.92
BugsMethod · 0.80
ChangeLabelsMethod · 0.80
EditCommentMethod · 0.80
SetTitleMethod · 0.80
IdMethod · 0.65
CloseMethod · 0.65
NewMethod · 0.45
AddCommentMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected