mirror of
https://github.com/gen2brain/cbconvert
synced 2026-06-30 09:11:54 +02:00
Add Command button, issue #33
This commit is contained in:
@@ -103,6 +103,27 @@ func TestThumbnail(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestArgs(t *testing.T) {
|
||||
opts := NewOptions()
|
||||
if got := opts.Args(); len(got) != 0 {
|
||||
t.Errorf("defaults should emit no flags, got %v", got)
|
||||
}
|
||||
|
||||
opts.Format = "webp"
|
||||
opts.Quality = 90
|
||||
opts.Effort = 4
|
||||
opts.Lossless = true
|
||||
opts.Width = 1200
|
||||
opts.Grayscale = true
|
||||
opts.OutDir = "/out"
|
||||
|
||||
got := strings.Join(opts.Args(), " ")
|
||||
want := "--width 1200 --format webp --quality 90 --effort 4 --lossless --grayscale --outdir /out"
|
||||
if got != want {
|
||||
t.Errorf("Args() = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConvertResize(t *testing.T) {
|
||||
tmpDir, err := os.MkdirTemp(os.TempDir(), "cbc")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user