forked from retoor/devplacepy
Code Farm: per-plot auto-replant pause and crop-lock check; community sync and node work
Continuous Delivery could never be turned off once a crop was planted. Add a one-shot per-plot "stop after harvest" flag (POST /game/plot/stop, Devii tool game_plot_stop, game_plots.stop_after_harvest), cleared by the next plant, autoreplant claim or Refactor. Autoreplant now also respects crop locks through the shared _crop_lock predicate. Plan and measurements in happyplanting.md. Also includes the pending community sync, node network and related work in the tree; the full suite passed (4999) with all of it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = (path) => fileURLToPath(new URL(`../${path}`, import.meta.url));
|
||||
const manifest = JSON.parse(readFileSync(root("manifest.json"), "utf8"));
|
||||
const PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
|
||||
|
||||
test("the manifest declares icons and the action icon, and every file is a PNG of its declared size", () => {
|
||||
assert.deepEqual(Object.keys(manifest.icons), ["16", "32", "48", "128"]);
|
||||
for (const [size, path] of Object.entries(manifest.icons)) {
|
||||
assert.ok(existsSync(root(path)), path);
|
||||
const data = readFileSync(root(path));
|
||||
assert.equal(data.subarray(0, 8).equals(PNG_SIGNATURE), true, path);
|
||||
assert.equal(data.subarray(12, 16).toString(), "IHDR", path);
|
||||
assert.equal(data.readUInt32BE(16), Number(size), `${path} width`);
|
||||
assert.equal(data.readUInt32BE(20), Number(size), `${path} height`);
|
||||
}
|
||||
for (const [size, path] of Object.entries(manifest.action.default_icon)) {
|
||||
assert.equal(manifest.icons[size], path);
|
||||
}
|
||||
});
|
||||
|
||||
test("build.sh ships the icons", () => {
|
||||
const script = readFileSync(root("build.sh"), "utf8");
|
||||
assert.match(script, /manifest\.json src ui icons README\.md/);
|
||||
assert.match(script, /\("src", "ui", "icons"\)/);
|
||||
});
|
||||
Reference in New Issue
Block a user