test(hashline): remove unsafe test assertions
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -16,11 +16,11 @@ function makeHangingClient(): {
|
|||||||
hangCount.value += 1
|
hangCount.value += 1
|
||||||
return new Promise<never>(() => {})
|
return new Promise<never>(() => {})
|
||||||
}
|
}
|
||||||
const client = {
|
const client = testCoerce<PluginInput["client"]>({
|
||||||
session: {
|
session: {
|
||||||
get: sessionGet,
|
get: sessionGet,
|
||||||
},
|
},
|
||||||
} as unknown as PluginInput["client"]
|
})
|
||||||
return { hangCount, client }
|
return { hangCount, client }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -459,7 +459,6 @@ const TEST_CASES: TestCase[] = [
|
|||||||
"Expected line 2 to be exactly 180 characters.",
|
"Expected line 2 to be exactly 180 characters.",
|
||||||
].join(" "),
|
].join(" "),
|
||||||
validate: (content) => {
|
validate: (content) => {
|
||||||
const expected = "L".repeat(180);
|
|
||||||
const lines = content.replace(/\r/g, "").trimEnd().split("\n");
|
const lines = content.replace(/\r/g, "").trimEnd().split("\n");
|
||||||
if (!lines[1]) {
|
if (!lines[1]) {
|
||||||
return { passed: false, reason: "line 2 is missing" };
|
return { passed: false, reason: "line 2 is missing" };
|
||||||
@@ -976,12 +975,12 @@ async function runTestCase(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const toolCalls = events.filter(
|
const toolCalls = testCoerce<ToolCallEvent[]>(events.filter(
|
||||||
(e) => e.type === "tool_call"
|
(e) => e.type === "tool_call"
|
||||||
) as unknown as ToolCallEvent[];
|
));
|
||||||
const toolResults = events.filter(
|
const toolResults = testCoerce<ToolResultEvent[]>(events.filter(
|
||||||
(e) => e.type === "tool_result"
|
(e) => e.type === "tool_result"
|
||||||
) as unknown as ToolResultEvent[];
|
));
|
||||||
|
|
||||||
const editCalls = toolCalls.filter((e) => e.tool_name === "edit_file");
|
const editCalls = toolCalls.filter((e) => e.tool_name === "edit_file");
|
||||||
const editCallIds = new Set(editCalls.map((e) => e.tool_call_id));
|
const editCallIds = new Set(editCalls.map((e) => e.tool_call_id));
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ const RESET = "\x1b[0m";
|
|||||||
const pass = (msg: string) => console.log(` ${GREEN}✓${RESET} ${msg}`);
|
const pass = (msg: string) => console.log(` ${GREEN}✓${RESET} ${msg}`);
|
||||||
const fail = (msg: string) => console.log(` ${RED}✗${RESET} ${msg}`);
|
const fail = (msg: string) => console.log(` ${RED}✗${RESET} ${msg}`);
|
||||||
const info = (msg: string) => console.log(` ${DIM}${msg}${RESET}`);
|
const info = (msg: string) => console.log(` ${DIM}${msg}${RESET}`);
|
||||||
const warn = (msg: string) => console.log(` ${YELLOW}⚠${RESET} ${msg}`);
|
|
||||||
|
|
||||||
// ── Test case definition ─────────────────────────────────────
|
// ── Test case definition ─────────────────────────────────────
|
||||||
interface TestCase {
|
interface TestCase {
|
||||||
@@ -669,12 +668,12 @@ async function runTestCase(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const toolCalls = events.filter(
|
const toolCalls = testCoerce<ToolCallEvent[]>(events.filter(
|
||||||
(e) => e.type === "tool_call"
|
(e) => e.type === "tool_call"
|
||||||
) as unknown as ToolCallEvent[];
|
));
|
||||||
const toolResults = events.filter(
|
const toolResults = testCoerce<ToolResultEvent[]>(events.filter(
|
||||||
(e) => e.type === "tool_result"
|
(e) => e.type === "tool_result"
|
||||||
) as unknown as ToolResultEvent[];
|
));
|
||||||
|
|
||||||
const editCalls = toolCalls.filter((e) => e.tool_name === "edit_file");
|
const editCalls = toolCalls.filter((e) => e.tool_name === "edit_file");
|
||||||
const editCallIds = new Set(editCalls.map((e) => e.tool_call_id));
|
const editCallIds = new Set(editCalls.map((e) => e.tool_call_id));
|
||||||
|
|||||||
Reference in New Issue
Block a user