Skip to content

Commit d4cb7fe

Browse files
author
ochafik
committed
test_tool_call: allow comment lines in now-multiline code strings (for functionary v3.2)
1 parent 3fbe84f commit d4cb7fe

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

examples/server/tests/unit/test_tool_call.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,4 +625,4 @@ def do_test_hello_world(server: ServerProcess, **kwargs):
625625
assert 'code' in actual_arguments, f"code not found in {json.dumps(actual_arguments)}"
626626
code = actual_arguments["code"]
627627
assert isinstance(code, str), f"Expected code to be a string, got {type(code)}: {json.dumps(code)}"
628-
assert re.match(r'''print\(("[Hh]ello,? [Ww]orld!?"|'[Hh]ello,? [Ww]orld!?')\)''', code), f'Expected hello world, got {code}'
628+
assert re.match(r'''print\(("[Hh]ello,? [Ww]orld!?"|'[Hh]ello,? [Ww]orld!?')\)''', re.sub(r'#.*\n?', '', code)), f'Expected hello world, got {code}'

tests/test-chat-parser.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,6 @@ static void test_json_with_dumped_args() {
148148
);
149149
}
150150

151-
// Full args.
152-
test(
153-
R"({"foo": "bar", "args": {"arg1": 1})",
154-
R"({"foo":"bar","args":"{\"arg1\":1}"})"
155-
);
156151
// Partial JSON w/ partial args
157152
test(
158153
R"({"foo": "bar", "args": {")",

0 commit comments

Comments
 (0)