Skip to content

Commit

Permalink
test: --no-preserve-aspect-ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
eddieantonio committed Dec 18, 2023
1 parent 6caa6a4 commit 0419255
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/out/512x512px_magenta.png/256.16x16.half-height.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
4 changes: 4 additions & 0 deletions tests/out/512x512px_magenta.png/256.16x8.half-height.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
8 changes: 8 additions & 0 deletions tests/out/512x512px_magenta.png/256.8x16.half-height.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
4 changes: 4 additions & 0 deletions tests/out/512x512px_magenta.png/256.8x8.half-height.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀
16 changes: 15 additions & 1 deletion tests/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright (c) 2017–2019 Eddie Antonio Santos <easantos@ualberta.ca>
# Copyright (c) 2017–2023 Eddie Antonio Santos <hello@eddieantonio.ca>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -68,6 +68,20 @@ imgcat_tests() {
assert_eq out/1px_256.png/256H.bin \
imgcat -H -d 256 img/1px_256.png

# Test aspect ratio preservation
assert_eq out/512x512px_magenta.png/256.16x16.half-height.bin \
imgcat -w 16 -r 16 -d 256 -H img/512x512px_magenta.png
assert_eq out/512x512px_magenta.png/256.8x8.half-height.bin \
imgcat -w 16 -r 8 -d 256 -H img/512x512px_magenta.png
assert_eq out/512x512px_magenta.png/256.8x8.half-height.bin \
imgcat -w 8 -r 16 -d 256 -H img/512x512px_magenta.png

# Test --no-preserve-aspect-ratio
assert_eq out/512x512px_magenta.png/256.16x8.half-height.bin \
imgcat -P -w 16 -r 8 -d 256 -H img/512x512px_magenta.png
assert_eq out/512x512px_magenta.png/256.8x16.half-height.bin \
imgcat -P -w 8 -r 16 -d 256 -H img/512x512px_magenta.png

### Internal sturf below: ###

# Test --x-terminal-override
Expand Down

0 comments on commit 0419255

Please sign in to comment.