aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-17 19:15:19 +0900
committernsfisis <nsfisis@gmail.com>2026-02-17 19:15:19 +0900
commit602cca615c733c79bc3930f37408a0e71ee40e62 (patch)
tree3a8bc6e148cf52f103e2af707c2407de61edfe18
parent1699d2bf679e336cc89ccab5bb8ef7e1101e721d (diff)
downloadphperkaigi-2026-albatross-602cca615c733c79bc3930f37408a0e71ee40e62.tar.gz
phperkaigi-2026-albatross-602cca615c733c79bc3930f37408a0e71ee40e62.tar.zst
phperkaigi-2026-albatross-602cca615c733c79bc3930f37408a0e71ee40e62.zip
fix(worker/php): format
-rw-r--r--worker/php/exec.mjs2
-rw-r--r--worker/php/lib.test.mjs21
2 files changed, 19 insertions, 4 deletions
diff --git a/worker/php/exec.mjs b/worker/php/exec.mjs
index 21bd93f..7403dfc 100644
--- a/worker/php/exec.mjs
+++ b/worker/php/exec.mjs
@@ -1,5 +1,5 @@
-import PHPWasm from "./php-wasm.js";
import { buildResult, createIOCallbacks, preprocessCode } from "./lib.mjs";
+import PHPWasm from "./php-wasm.js";
process.once("message", async ({ code: originalCode, input }) => {
const code = preprocessCode(originalCode);
diff --git a/worker/php/lib.test.mjs b/worker/php/lib.test.mjs
index 6613066..d4f420f 100644
--- a/worker/php/lib.test.mjs
+++ b/worker/php/lib.test.mjs
@@ -122,7 +122,12 @@ describe("createIOCallbacks", () => {
describe("buildResult", () => {
it("returns success when err is null and result is 0", () => {
- const result = buildResult(null, 0, () => "out", () => "");
+ const result = buildResult(
+ null,
+ 0,
+ () => "out",
+ () => "",
+ );
expect(result).toEqual({
status: "success",
stdout: "out",
@@ -131,7 +136,12 @@ describe("buildResult", () => {
});
it("returns runtime_error when result is non-zero", () => {
- const result = buildResult(null, 1, () => "out", () => "err");
+ const result = buildResult(
+ null,
+ 1,
+ () => "out",
+ () => "err",
+ );
expect(result).toEqual({
status: "runtime_error",
stdout: "out",
@@ -141,7 +151,12 @@ describe("buildResult", () => {
it("returns runtime_error with concatenated stderr when err is thrown", () => {
const err = new Error("fatal");
- const result = buildResult(err, undefined, () => "out", () => "err");
+ const result = buildResult(
+ err,
+ undefined,
+ () => "out",
+ () => "err",
+ );
expect(result.status).toBe("runtime_error");
expect(result.stdout).toBe("out");
expect(result.stderr).toContain("err");