(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func TestUpdateCmd_ArgsValidation(t *testing.T) { |
| 73 | // Cleanup. |
| 74 | dirs.RemoveAllForTest() |
| 75 | |
| 76 | tests := []struct { |
| 77 | name string |
| 78 | confRepo bool |
| 79 | portsRepo bool |
| 80 | recursive bool |
| 81 | args []string |
| 82 | expectError bool |
| 83 | }{ |
| 84 | { |
| 85 | name: "conf_repo_without_args_should_succeed", |
| 86 | confRepo: true, |
| 87 | args: []string{}, |
| 88 | expectError: false, |
| 89 | }, |
| 90 | { |
| 91 | name: "conf_repo_with_args_should_fail", |
| 92 | confRepo: true, |
| 93 | args: []string{"zlib@1.3.1"}, |
| 94 | expectError: true, |
| 95 | }, |
| 96 | { |
| 97 | name: "ports_repo_without_args_should_succeed", |
| 98 | portsRepo: true, |
| 99 | args: []string{}, |
| 100 | expectError: false, |
| 101 | }, |
| 102 | { |
| 103 | name: "ports_repo_with_args_should_fail", |
| 104 | portsRepo: true, |
| 105 | args: []string{"zlib@1.3.1"}, |
| 106 | expectError: true, |
| 107 | }, |
| 108 | { |
| 109 | name: "recursive_with_conf_repo_should_fail", |
| 110 | confRepo: true, |
| 111 | recursive: true, |
| 112 | args: []string{}, |
| 113 | expectError: true, |
| 114 | }, |
| 115 | { |
| 116 | name: "no_repo_flags_without_args_should_fail", |
| 117 | args: []string{}, |
| 118 | expectError: true, |
| 119 | }, |
| 120 | { |
| 121 | name: "no_repo_flags_with_args_should_succeed", |
| 122 | args: []string{"zlib@1.3.1"}, |
| 123 | expectError: false, |
| 124 | }, |
| 125 | { |
| 126 | name: "recursive_with_port_args_should_succeed", |
| 127 | recursive: true, |
| 128 | args: []string{"ffmpeg@3.4.13"}, |
| 129 | expectError: false, |
nothing calls this directly
no test coverage detected