Files
podman/pkg/machine/define/image_format_test.go
Paul Holzinger 5c1ed12d8d enable gofumpt formatter
Based on our discussion gofumpt won the vote so use that one via
golangci-lint.

https://github.com/containers/podman/discussions/27291

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-11 12:32:46 +01:00

76 lines
1.1 KiB
Go

package define
import "testing"
func TestImageFormat_Kind(t *testing.T) {
tests := []struct {
name string
imf ImageFormat
want string
}{
{
name: "vhdx",
imf: Vhdx,
want: "vhdx",
},
{
name: "qcow2",
imf: Qcow,
want: "qcow2",
},
{
name: "raw",
imf: Raw,
want: "raw",
},
{
name: "tar",
imf: Tar,
want: "tar",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.imf.Kind(); got != tt.want {
t.Errorf("Kind() = %v, want %v", got, tt.want)
}
})
}
}
func TestImageFormat_KindWithCompression(t *testing.T) {
tests := []struct {
name string
imf ImageFormat
want string
}{
{
name: "vhdx",
imf: Vhdx,
want: "vhdx.zst",
},
{
name: "qcow2",
imf: Qcow,
want: "qcow2.zst",
},
{
name: "raw",
imf: Raw,
want: "raw.zst",
},
{
name: "tar.zst",
imf: Tar,
want: "tar.zst",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.imf.KindWithCompression(); got != tt.want {
t.Errorf("String() = %v, want %v", got, tt.want)
}
})
}
}