e2etests-cli: Add sketch test

This commit is contained in:
Anmol Sethi 2023-03-02 20:09:05 -08:00
parent eae8fdeb29
commit 90c84ea6f6
No known key found for this signature in database
GPG key ID: 25BC68888A99A8BA
3 changed files with 11 additions and 1 deletions

View file

@ -33,7 +33,17 @@ func TestCLI_E2E(t *testing.T) {
name: "hello_world_png_pad", name: "hello_world_png_pad",
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) { run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
writeFile(t, dir, "hello-world.d2", `x -> y`) writeFile(t, dir, "hello-world.d2", `x -> y`)
err := runTestMain(t, ctx, dir, env, "-pad 4000", "hello-world.d2", "hello-world.png") err := runTestMain(t, ctx, dir, env, "--pad=400", "hello-world.d2", "hello-world.png")
assert.Success(t, err)
png := readFile(t, dir, "hello-world.png")
assert.Testdata(t, ".png", png)
},
},
{
name: "hello_world_png_sketch",
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
writeFile(t, dir, "hello-world.d2", `x -> y`)
err := runTestMain(t, ctx, dir, env, "--sketch", "hello-world.d2", "hello-world.png")
assert.Success(t, err) assert.Success(t, err)
png := readFile(t, dir, "hello-world.png") png := readFile(t, dir, "hello-world.png")
assert.Testdata(t, ".png", png) assert.Testdata(t, ".png", png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB