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

Function testCases

bridge/github/export_test.go:36–130  ·  view source on GitHub ↗
(t *testing.T, repo *cache.RepoCache)

Source from the content-addressed store, hash-verified

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

Callers 1

TestGithubPushPullFunction · 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