From 158b279926474e2339f43946cfece867023e6390 Mon Sep 17 00:00:00 2001 From: Rasmus Moorats Date: Fri, 7 Jan 2022 15:50:43 +0200 Subject: [PATCH] add dead simple tests for PPM files --- tests/all.nim | 1 + tests/fileformats/ppm/feep.p3.master.ppm | 8 ++++++++ tests/fileformats/ppm/feep.p3.ppm | Bin 0 -> 59 bytes tests/fileformats/ppm/feep.p6.master.ppm | Bin 0 -> 59 bytes tests/fileformats/ppm/feep.p6.ppm | Bin 0 -> 59 bytes tests/test_ppm.nim | 8 ++++++++ 6 files changed, 17 insertions(+) create mode 100644 tests/fileformats/ppm/feep.p3.master.ppm create mode 100644 tests/fileformats/ppm/feep.p3.ppm create mode 100644 tests/fileformats/ppm/feep.p6.master.ppm create mode 100644 tests/fileformats/ppm/feep.p6.ppm create mode 100644 tests/test_ppm.nim diff --git a/tests/all.nim b/tests/all.nim index 69850f8..03ecbcf 100644 --- a/tests/all.nim +++ b/tests/all.nim @@ -10,6 +10,7 @@ import test_paints, test_paths, test_png, + test_ppm, test_qoi, test_svg, ../examples/text, diff --git a/tests/fileformats/ppm/feep.p3.master.ppm b/tests/fileformats/ppm/feep.p3.master.ppm new file mode 100644 index 0000000..221e752 --- /dev/null +++ b/tests/fileformats/ppm/feep.p3.master.ppm @@ -0,0 +1,8 @@ +P3 +# feep.p3.master.ppm +4 4 +15 + 0 0 0 0 0 0 0 0 0 15 0 15 + 0 0 0 0 15 7 0 0 0 0 0 0 + 0 0 0 0 0 0 0 15 7 0 0 0 +15 0 15 0 0 0 0 0 0 0 0 0 diff --git a/tests/fileformats/ppm/feep.p3.ppm b/tests/fileformats/ppm/feep.p3.ppm new file mode 100644 index 0000000000000000000000000000000000000000..d2cbd0db64dd5ee88994b66dcf3fb4ed43c9c209 GIT binary patch literal 59 kcmWGA<1$e&;W9EcU&u0Wb~bLZ!e0013MYu>b%7 literal 0 HcmV?d00001 diff --git a/tests/fileformats/ppm/feep.p6.master.ppm b/tests/fileformats/ppm/feep.p6.master.ppm new file mode 100644 index 0000000000000000000000000000000000000000..d2cbd0db64dd5ee88994b66dcf3fb4ed43c9c209 GIT binary patch literal 59 kcmWGA<1$e&;W9EcU&u0Wb~bLZ!e0013MYu>b%7 literal 0 HcmV?d00001 diff --git a/tests/fileformats/ppm/feep.p6.ppm b/tests/fileformats/ppm/feep.p6.ppm new file mode 100644 index 0000000000000000000000000000000000000000..d2cbd0db64dd5ee88994b66dcf3fb4ed43c9c209 GIT binary patch literal 59 kcmWGA<1$e&;W9EcU&u0Wb~bLZ!e0013MYu>b%7 literal 0 HcmV?d00001 diff --git a/tests/test_ppm.nim b/tests/test_ppm.nim new file mode 100644 index 0000000..06256dd --- /dev/null +++ b/tests/test_ppm.nim @@ -0,0 +1,8 @@ +import pixie/fileformats/ppm + +block: + for format in @["p3", "p6"]: + let image = decodePpm(readFile( + "tests/fileformats/ppm/feep." & $format & ".master.ppm" + )) + writeFile("tests/fileformats/ppm/feep." & $format & ".ppm", encodePpm(image))