MCPcopy
hub / github.com/cli/cli / TestNewCmdCopy

Function TestNewCmdCopy

pkg/cmd/project/copy/copy_test.go:14–113  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestNewCmdCopy(t *testing.T) {
15 tests := []struct {
16 name string
17 cli string
18 wants copyOpts
19 wantsErr bool
20 wantsErrMsg string
21 wantsExporter bool
22 }{
23 {
24 name: "not-a-number",
25 cli: "x --title t",
26 wantsErr: true,
27 wantsErrMsg: "invalid number: x",
28 },
29 {
30 name: "title",
31 cli: "--title t",
32 wants: copyOpts{
33 title: "t",
34 },
35 },
36 {
37 name: "number",
38 cli: "123 --title t",
39 wants: copyOpts{
40 number: 123,
41 title: "t",
42 },
43 },
44 {
45 name: "source-owner",
46 cli: "--source-owner monalisa --title t",
47 wants: copyOpts{
48 sourceOwner: "monalisa",
49 title: "t",
50 },
51 },
52 {
53 name: "target-owner",
54 cli: "--target-owner monalisa --title t",
55 wants: copyOpts{
56 targetOwner: "monalisa",
57 title: "t",
58 },
59 },
60 {
61 name: "drafts",
62 cli: "--drafts --title t",
63 wants: copyOpts{
64 includeDraftIssues: true,
65 title: "t",
66 },
67 },
68 {
69 name: "json",
70 cli: "--format json --title t",
71 wants: copyOpts{

Callers

nothing calls this directly

Calls 5

TestFunction · 0.92
NewCmdCopyFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected