Skip to content

Commit c9cccf0

Browse files
committed
add unit tests for unquoted tool names
1 parent c2a0394 commit c9cccf0

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/vs/editor/test/common/codecs/frontMatterDecoder/frontMatterDecoder.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ suite('FrontMatterDecoder', () => {
358358
]);
359359
});
360360

361-
362361
test('• redundant commas', async () => {
363362
const test = disposables.add(new TestFrontMatterDecoder());
364363

src/vs/workbench/contrib/chat/test/common/promptSyntax/parsers/textModelPromptParser.test.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,38 @@ suite('TextModelPromptParser', () => {
556556
]);
557557
});
558558

559+
suite('• tools metadata', () => {
560+
test('• tool names can be quoted and non-quoted string', async () => {
561+
const test = createTest(
562+
URI.file('/absolute/folder/and/a/my.prompt.md'),
563+
[
564+
/* 01 */"---",
565+
/* 02 */"tools: [tool1, 'tool2', \"tool3\", tool-4]",
566+
/* 03 */"---",
567+
/* 04 */"The cactus on my desk has a thriving Instagram account.",
568+
],
569+
PROMPT_LANGUAGE_ID,
570+
);
571+
572+
await test.allSettled();
573+
574+
const { header, metadata } = test.parser;
575+
assertDefined(
576+
header,
577+
'Prompt header must be defined.',
578+
);
579+
580+
const { tools } = metadata;
581+
assert.deepStrictEqual(
582+
tools,
583+
['tool1', 'tool2', 'tool3', 'tool-4'],
584+
'Mode metadata must have correct value.',
585+
);
586+
587+
await test.validateHeaderDiagnostics([]);
588+
});
589+
});
590+
559591
suite('• applyTo metadata', () => {
560592
suite('• language', () => {
561593
test('• prompt', async () => {

0 commit comments

Comments
 (0)