(t *testing.T)
| 20 | ) |
| 21 | |
| 22 | func TestNewCmdRerun(t *testing.T) { |
| 23 | tests := []struct { |
| 24 | name string |
| 25 | cli string |
| 26 | tty bool |
| 27 | wants RerunOptions |
| 28 | wantsErr bool |
| 29 | }{ |
| 30 | { |
| 31 | name: "blank nontty", |
| 32 | wantsErr: true, |
| 33 | }, |
| 34 | { |
| 35 | name: "blank tty", |
| 36 | tty: true, |
| 37 | wants: RerunOptions{ |
| 38 | Prompt: true, |
| 39 | }, |
| 40 | }, |
| 41 | { |
| 42 | name: "with arg nontty", |
| 43 | cli: "1234", |
| 44 | wants: RerunOptions{ |
| 45 | RunID: "1234", |
| 46 | }, |
| 47 | }, |
| 48 | { |
| 49 | name: "with arg tty", |
| 50 | tty: true, |
| 51 | cli: "1234", |
| 52 | wants: RerunOptions{ |
| 53 | RunID: "1234", |
| 54 | }, |
| 55 | }, |
| 56 | { |
| 57 | name: "failed arg nontty", |
| 58 | cli: "4321 --failed", |
| 59 | wants: RerunOptions{ |
| 60 | RunID: "4321", |
| 61 | OnlyFailed: true, |
| 62 | }, |
| 63 | }, |
| 64 | { |
| 65 | name: "failed arg", |
| 66 | tty: true, |
| 67 | cli: "--failed", |
| 68 | wants: RerunOptions{ |
| 69 | Prompt: true, |
| 70 | OnlyFailed: true, |
| 71 | }, |
| 72 | }, |
| 73 | { |
| 74 | name: "with arg job", |
| 75 | tty: true, |
| 76 | cli: "--job 1234", |
| 77 | wants: RerunOptions{ |
| 78 | JobID: "1234", |
| 79 | }, |
nothing calls this directly
no test coverage detected