(t *testing.T)
| 158 | } |
| 159 | |
| 160 | func TestPrintImageTreeGolden(t *testing.T) { |
| 161 | testCases := []struct { |
| 162 | name string |
| 163 | view treeView |
| 164 | expanded bool |
| 165 | }{ |
| 166 | { |
| 167 | name: "width-calculation-untagged", |
| 168 | expanded: false, |
| 169 | view: treeView{ |
| 170 | images: []topImage{ |
| 171 | { |
| 172 | Names: []string{"a:1"}, |
| 173 | Details: imageDetails{ |
| 174 | ID: "sha256:1111111111111111111111111111111111111111111111111111111111111111", |
| 175 | DiskUsage: "5.5 MB", |
| 176 | InUse: false, |
| 177 | ContentSize: "2.5 MB", |
| 178 | }, |
| 179 | }, |
| 180 | { |
| 181 | // Untagged image name is longer than "a:1" |
| 182 | Names: []string{}, |
| 183 | Details: imageDetails{ |
| 184 | ID: "sha256:2222222222222222222222222222222222222222222222222222222222222222", |
| 185 | DiskUsage: "3.2 MB", |
| 186 | InUse: false, |
| 187 | ContentSize: "1.6 MB", |
| 188 | }, |
| 189 | }, |
| 190 | { |
| 191 | Names: []string{"short:v1"}, |
| 192 | Details: imageDetails{ |
| 193 | ID: "sha256:3333333333333333333333333333333333333333333333333333333333333333", |
| 194 | DiskUsage: "7.1 MB", |
| 195 | InUse: true, |
| 196 | ContentSize: "3.5 MB", |
| 197 | }, |
| 198 | }, |
| 199 | }, |
| 200 | imageSpacing: false, |
| 201 | }, |
| 202 | }, |
| 203 | { |
| 204 | name: "expanded-view-with-platforms", |
| 205 | expanded: false, |
| 206 | view: treeView{ |
| 207 | images: []topImage{ |
| 208 | { |
| 209 | Names: []string{"multiplatform:latest"}, |
| 210 | Details: imageDetails{ |
| 211 | ID: "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |
| 212 | DiskUsage: "25.5 MB", |
| 213 | InUse: true, |
| 214 | ContentSize: "20.2 MB", |
| 215 | }, |
| 216 | Children: []subImage{ |
| 217 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…