(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestNewCmdEdit(t *testing.T) { |
| 41 | tests := []struct { |
| 42 | name string |
| 43 | cli string |
| 44 | wants EditOptions |
| 45 | wantsErr bool |
| 46 | }{ |
| 47 | { |
| 48 | name: "no flags", |
| 49 | cli: "123", |
| 50 | wants: EditOptions{ |
| 51 | Selector: "123", |
| 52 | }, |
| 53 | }, |
| 54 | { |
| 55 | name: "filename", |
| 56 | cli: "123 --filename cool.md", |
| 57 | wants: EditOptions{ |
| 58 | Selector: "123", |
| 59 | EditFilename: "cool.md", |
| 60 | }, |
| 61 | }, |
| 62 | { |
| 63 | name: "add", |
| 64 | cli: "123 --add cool.md", |
| 65 | wants: EditOptions{ |
| 66 | Selector: "123", |
| 67 | AddFilename: "cool.md", |
| 68 | }, |
| 69 | }, |
| 70 | { |
| 71 | name: "add with source", |
| 72 | cli: "123 --add cool.md -", |
| 73 | wants: EditOptions{ |
| 74 | Selector: "123", |
| 75 | AddFilename: "cool.md", |
| 76 | SourceFile: "-", |
| 77 | }, |
| 78 | }, |
| 79 | { |
| 80 | name: "description", |
| 81 | cli: `123 --desc "my new description"`, |
| 82 | wants: EditOptions{ |
| 83 | Selector: "123", |
| 84 | Description: "my new description", |
| 85 | }, |
| 86 | }, |
| 87 | { |
| 88 | name: "remove", |
| 89 | cli: "123 --remove cool.md", |
| 90 | wants: EditOptions{ |
| 91 | Selector: "123", |
| 92 | RemoveFilename: "cool.md", |
| 93 | }, |
| 94 | }, |
| 95 | { |
| 96 | name: "add and remove are mutually exclusive", |
| 97 | cli: "123 --add cool.md --remove great.md", |
nothing calls this directly
no test coverage detected