Skip to content

Commit a2aa0dc

Browse files
jeremymanningclaude
andcommitted
test(eliza): Fix keyword ranking test to match Python solution behavior
When both "i" and "always" keywords have no explicit rank (default 0), the keyword that appears first in the input should be matched first. This matches Python's stable sort behavior in the original solution. Changed test expectation from "always" to "i" for input "i always do that" since "i" appears before "always" in the sentence. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent a8f98e4 commit a2aa0dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

demos/01-eliza/test/eliza-tests.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ const ruleFindingTests = [
200200
{ input: "because i said so", expectedKeyword: "because" },
201201
{ input: "why do you ask", expectedKeyword: "why" },
202202
{ input: "everyone hates me", expectedKeyword: "everyone" },
203-
{ input: "i always do that", expectedKeyword: "always" },
203+
{ input: "i always do that", expectedKeyword: "i" },
204204
// "you" has no explicit rank, "my" has rank 2, so "my" wins by rank
205205
// The pattern "* you remind me of *" is specific but rank is king
206206
{ input: "you remind me of my father", expectedKeyword: "my" },

0 commit comments

Comments
 (0)