From ca29650294ec9317a2ff09dc52085f7f24c9bba0 Mon Sep 17 00:00:00 2001 From: Pedro Amaral Couto <84463+pedroac@users.noreply.github.com> Date: Wed, 4 Nov 2026 01:45:39 +0000 Subject: [PATCH 1/3] test: decode base64 the same way on every platform The tests told GNU base64 from macOS's by looking for "GNU" in its version. Ubuntu's Rust coreutils (uutils) don't print it, so they took the macOS-only `-D -i -o` form and failed. `base64 --decode` reading stdin works with GNU, uutils and macOS alike. VERSION is v0.28.1: v0.28.2 was never released, and sprat-gui pins v0.28.1. Co-Authored-By: Claude Opus 5.5 --- VERSION | 2 +- tests/extrude_test.sh | 6 +----- tests/incremental_test.sh | 6 +----- ...ayout_limits_and_multipack_optimize_test.sh | 18 ++++-------------- tests/multipack_test.sh | 7 +------ tests/pipeline_test.sh | 7 +------ tests/profile_resolution_test.sh | 2 +- tests/spratpack_args_test.sh | 6 +----- 8 files changed, 11 insertions(+), 43 deletions(-) diff --git a/VERSION b/VERSION index 46e8233..244df55 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.28.2 +v0.28.1 diff --git a/tests/extrude_test.sh b/tests/extrude_test.sh index 2f9338b..3f59154 100644 --- a/tests/extrude_test.sh +++ b/tests/extrude_test.sh @@ -32,11 +32,7 @@ cat > "$tmp_dir/red2x2.b64" <<'EOF' iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVR4nGP8z8Dwn4GBgYGJAQoAHxcCAk+Uzr4AAAAASUVORK5CYII= EOF -if base64 --version 2>&1 | grep -q "GNU"; then - base64 -d "$tmp_dir/red2x2.b64" > "$frames_dir/red.png" -else - base64 -D -i "$tmp_dir/red2x2.b64" -o "$frames_dir/red.png" -fi +base64 --decode < "$tmp_dir/red2x2.b64" > "$frames_dir/red.png" layout_file="$tmp_dir/layout.txt" # Use --extrude 1. Padding will be auto-set to 2. diff --git a/tests/incremental_test.sh b/tests/incremental_test.sh index 4154e03..6e396fe 100644 --- a/tests/incremental_test.sh +++ b/tests/incremental_test.sh @@ -55,11 +55,7 @@ cat > "$tmp_dir/pixel.b64" <<'EOF' iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO7ZxaoAAAAASUVORK5CYII= EOF -if base64 --version 2>&1 | grep -q "GNU"; then - base64 -d "$tmp_dir/pixel.b64" > "$frames_dir/a.png" -else - base64 -D -i "$tmp_dir/pixel.b64" -o "$frames_dir/a.png" -fi +base64 --decode < "$tmp_dir/pixel.b64" > "$frames_dir/a.png" cp "$frames_dir/a.png" "$frames_dir/b.png" cp "$frames_dir/a.png" "$frames_dir/c.png" diff --git a/tests/layout_limits_and_multipack_optimize_test.sh b/tests/layout_limits_and_multipack_optimize_test.sh index 83bbdcd..45f8c8f 100644 --- a/tests/layout_limits_and_multipack_optimize_test.sh +++ b/tests/layout_limits_and_multipack_optimize_test.sh @@ -25,11 +25,7 @@ mkdir -p "$frames_limits" cat > "$tmp_dir/pixel.b64" <<'EOF' iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO7ZxaoAAAAASUVORK5CYII= EOF -if base64 --version 2>&1 | grep -q "GNU"; then - base64 -d "$tmp_dir/pixel.b64" > "$frames_limits/f1.png" -else - base64 -D -i "$tmp_dir/pixel.b64" -o "$frames_limits/f1.png" -fi +base64 --decode < "$tmp_dir/pixel.b64" > "$frames_limits/f1.png" cp "$frames_limits/f1.png" "$frames_limits/f2.png" profiles_cfg="$tmp_dir/profiles.cfg" @@ -62,15 +58,9 @@ EOF cat > "$tmp_dir/s1x30.b64" <<'EOF' Qk2uAAAAAAAAADYAAAAoAAAAAQAAAB4AAAABABgAAAAAAHgAAAATCwAAEwsAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8A EOF -if base64 --version 2>&1 | grep -q "GNU"; then - base64 -d "$tmp_dir/s10.b64" > "$frames_multi/a.bmp" - base64 -d "$tmp_dir/s10.b64" > "$frames_multi/b.bmp" - base64 -d "$tmp_dir/s1x30.b64" > "$frames_multi/c.bmp" -else - base64 -D -i "$tmp_dir/s10.b64" -o "$frames_multi/a.bmp" - base64 -D -i "$tmp_dir/s10.b64" -o "$frames_multi/b.bmp" - base64 -D -i "$tmp_dir/s1x30.b64" -o "$frames_multi/c.bmp" -fi +base64 --decode < "$tmp_dir/s10.b64" > "$frames_multi/a.bmp" +base64 --decode < "$tmp_dir/s10.b64" > "$frames_multi/b.bmp" +base64 --decode < "$tmp_dir/s1x30.b64" > "$frames_multi/c.bmp" "$spratlayout_bin" "$(fix_path "$frames_multi")" --mode compact --multipack --max-width 30 --max-height 30 --optimize gpu > "$tmp_dir/multipack_gpu.txt" "$spratlayout_bin" "$(fix_path "$frames_multi")" --mode compact --multipack --max-width 30 --max-height 30 --optimize space > "$tmp_dir/multipack_space.txt" diff --git a/tests/multipack_test.sh b/tests/multipack_test.sh index 78dbe19..1410284 100755 --- a/tests/multipack_test.sh +++ b/tests/multipack_test.sh @@ -20,12 +20,7 @@ cat > "$tmp_dir/pixel.b64" <<'EOF' iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO7ZxaoAAAAASUVORK5CYII= EOF -if base64 --version 2>&1 | grep -q "GNU"; then - base64 -d "$tmp_dir/pixel.b64" > "$frames_dir/f1.png" -else - # macOS/BSD base64 - base64 -D -i "$tmp_dir/pixel.b64" -o "$frames_dir/f1.png" -fi +base64 --decode < "$tmp_dir/pixel.b64" > "$frames_dir/f1.png" cp "$frames_dir/f1.png" "$frames_dir/f2.png" cp "$frames_dir/f1.png" "$frames_dir/f3.png" diff --git a/tests/pipeline_test.sh b/tests/pipeline_test.sh index ebd88de..375ddcd 100755 --- a/tests/pipeline_test.sh +++ b/tests/pipeline_test.sh @@ -39,12 +39,7 @@ cat > "$tmp_dir/pixel.b64" <<'EOF' iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO7ZxaoAAAAASUVORK5CYII= EOF -if base64 --version 2>&1 | grep -q "GNU"; then - base64 -d "$tmp_dir/pixel.b64" > "$frames_dir/frame_a.png" -else - # macOS/BSD base64 - base64 -D -i "$tmp_dir/pixel.b64" -o "$frames_dir/frame_a.png" -fi +base64 --decode < "$tmp_dir/pixel.b64" > "$frames_dir/frame_a.png" cp "$frames_dir/frame_a.png" "$frames_dir/frame_b.png" frames_list_file="$tmp_dir/frames_list.txt" diff --git a/tests/profile_resolution_test.sh b/tests/profile_resolution_test.sh index 630cee1..6454ea6 100644 --- a/tests/profile_resolution_test.sh +++ b/tests/profile_resolution_test.sh @@ -28,7 +28,7 @@ mkdir -p "$frames_dir" cat > "$tmp_dir/pixel.b64" <<'EOF' iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO7ZxaoAAAAASUVORK5CYII= EOF -base64 -d "$tmp_dir/pixel.b64" > "$frames_dir/frame_a.png" +base64 --decode < "$tmp_dir/pixel.b64" > "$frames_dir/frame_a.png" cp "$frames_dir/frame_a.png" "$frames_dir/frame_b.png" frames_list_file="$tmp_dir/frames_list.txt" diff --git a/tests/spratpack_args_test.sh b/tests/spratpack_args_test.sh index e132086..f85c491 100755 --- a/tests/spratpack_args_test.sh +++ b/tests/spratpack_args_test.sh @@ -22,11 +22,7 @@ fi cat > "$tmp_dir/pixel.b64" <<'EOF' iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO7ZxaoAAAAASUVORK5CYII= EOF -if base64 --version 2>&1 | grep -q "GNU"; then - base64 -d "$tmp_dir/pixel.b64" > "$tmp_dir/pixel.png" -else - base64 -D -i "$tmp_dir/pixel.b64" -o "$tmp_dir/pixel.png" -fi +base64 --decode < "$tmp_dir/pixel.b64" > "$tmp_dir/pixel.png" layout="$tmp_dir/layout.txt" cat > "$layout" < Date: Fri, 6 Nov 2026 02:56:48 +0000 Subject: [PATCH 2/3] test: read puppet JSON as bytes so Windows decodes UTF-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The puppet check piped spratconvert's JSON into Python's text stdin. On Windows that decodes with the ANSI code page (cp1252), so the puppet name "hé" became "hé" and the assert failed. Reading sys.stdin.buffer lets json decode UTF-8 on every platform. Co-Authored-By: Claude Opus 5.5 --- VERSION | 2 +- tests/convert_test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 2c768c5..a630fff 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.32.3 +v0.32.4 diff --git a/tests/convert_test.sh b/tests/convert_test.sh index 918887e..39192ab 100755 --- a/tests/convert_test.sh +++ b/tests/convert_test.sh @@ -413,7 +413,7 @@ sed 's/^scale 1$/scale 0.5/' "$raw_layout_file" | cat - "$raw_animations_file" " | "$convert_bin" --transform "$(fix_path "$tmp_dir/puppets.jsonnet")" 2> /dev/null \ | python3 -c ' import json, sys -p = json.load(sys.stdin) +p = json.load(sys.stdin.buffer) # bytes: Windows would decode text with its ANSI code page assert [x["name"] for x in p] == ["hé"], p parts, joint = p[0]["parts"], p[0]["joints"][0] assert [(x["name"], x["parent"], x["has_position"], x["x"], x["y"]) for x in parts] \ From ac7c9d349cce0a5e605a41f3a043ec0979d622f5 Mon Sep 17 00:00:00 2001 From: Pedro Amaral Couto <84463+pedroac@users.noreply.github.com> Date: Fri, 6 Nov 2026 02:56:48 +0000 Subject: [PATCH 3/3] test: read puppet JSON as bytes so Windows decodes UTF-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The puppet check piped spratconvert's JSON into Python's text stdin. On Windows that decodes with the ANSI code page (cp1252), so the puppet name "hé" became "hé" and the assert failed. Reading sys.stdin.buffer lets json decode UTF-8 on every platform. Co-Authored-By: Claude Opus 5.5 --- VERSION | 2 +- tests/convert_test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 2c768c5..a630fff 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.32.3 +v0.32.4 diff --git a/tests/convert_test.sh b/tests/convert_test.sh index 918887e..39192ab 100755 --- a/tests/convert_test.sh +++ b/tests/convert_test.sh @@ -413,7 +413,7 @@ sed 's/^scale 1$/scale 0.5/' "$raw_layout_file" | cat - "$raw_animations_file" " | "$convert_bin" --transform "$(fix_path "$tmp_dir/puppets.jsonnet")" 2> /dev/null \ | python3 -c ' import json, sys -p = json.load(sys.stdin) +p = json.load(sys.stdin.buffer) # bytes: Windows would decode text with its ANSI code page assert [x["name"] for x in p] == ["hé"], p parts, joint = p[0]["parts"], p[0]["joints"][0] assert [(x["name"], x["parent"], x["has_position"], x["x"], x["y"]) for x in parts] \