truss

Summary #

2 suites · 9 scenarios

Contents #

truss convert (filesystem footprint) #

Source: test/e2e/tools/truss/changes.atago.yaml

Scenario: convert PNG->JPEG creates only the output file #

only when truss --version succeeds · skipped on Windows

Given #

  • Fixture file in.png is created.

When #

truss convert in.png -o out.jpg

Then #

  • exit code is 0
  • the step changed exactly created out.jpg, modified nothing, deleted nothing
  • image out.jpg is jpeg, width 2, height 2

Generated artifacts #

  • out.jpg

Scenario: convert to a glob-matched output honors path.Match #

only when truss --version succeeds · skipped on Windows

Given #

  • Fixture file in.png is created.

When #

truss convert in.png -o thumb.webp --format webp

Then #

  • exit code is 0
  • the step changed exactly created *.webp, modified nothing, deleted nothing

truss image conversion #

Source: test/e2e/tools/truss/convert.atago.yaml

Scenario: inspect reports PNG format and dimensions as JSON #

only when truss --version succeeds

Given #

  • Fixture file in.png is created.

When #

truss inspect in.png

Then #

  • exit code is 0
  • stdout at $.format equals png
  • stdout at $.width equals 16
  • stdout at $.height equals 16

Scenario: convert PNG to JPEG yields a same-size opaque JPEG #

only when truss --version succeeds

Given #

  • Fixture file in.png is created.

When #

truss convert in.png -o out.jpg

Then #

  • exit code is 0
  • image out.jpg is jpeg, width 16, height 16, has no alpha

Generated artifacts #

  • out.jpg

Scenario: resize with fit=fill produces the requested dimensions #

only when truss --version succeeds

Given #

  • Fixture file in.png is created.

When #

truss convert in.png -o thumb.png --width 8 --height 8 --fit fill

Then #

  • exit code is 0
  • image thumb.png is png, width 8, height 8

Generated artifacts #

  • thumb.png

Scenario: convert to WebP yields a WebP of the same dimensions #

only when truss --version succeeds

Given #

  • Fixture file in.png is created.

When #

truss convert in.png -o out.webp --format webp

Then #

  • exit code is 0
  • image out.webp is webp, width 16, height 16

Generated artifacts #

  • out.webp

Scenario: a high-quality JPEG stays visually close to the source #

only when truss --version succeeds

Given #

  • Fixture file in.png is created.

When #

truss convert in.png -o out.jpg --quality 100

Then #

  • exit code is 0
  • image out.jpg similar to testdata/sample.png

Expected output #

expected image testdata/sample.png: expected image testdata/sample.png

Generated artifacts #

  • out.jpg

Scenario: a lossless PNG re-encode is pixel-identical to the source #

only when truss --version succeeds

Given #

  • Fixture file in.png is created.

When #

truss convert in.png -o copy.png

Then #

  • exit code is 0
  • image copy.png similar to testdata/sample.png

Expected output #

expected image testdata/sample.png: expected image testdata/sample.png

Generated artifacts #

  • copy.png

Scenario: a missing input file exits with the I/O error code #

only when truss --version succeeds

When #

truss convert does-not-exist.png -o out.jpg

Then #

  • exit code is 2
  • stderr contains does-not-exist.png