@@ -31,14 +31,10 @@ describe("Built-in Tools", async () => {
3131
3232 describe ( "view" , ( ) => {
3333 it ( "should read file with line range" , async ( ) => {
34- await writeFile (
35- join ( workDir , "lines.txt" ) ,
36- "line1\nline2\nline3\nline4\nline5\n"
37- ) ;
34+ await writeFile ( join ( workDir , "lines.txt" ) , "line1\nline2\nline3\nline4\nline5\n" ) ;
3835 const session = await client . createSession ( ) ;
3936 const msg = await session . sendAndWait ( {
40- prompt :
41- "Read lines 2 through 4 of the file 'lines.txt' in this directory. Tell me what those lines contain." ,
37+ prompt : "Read lines 2 through 4 of the file 'lines.txt' in this directory. Tell me what those lines contain." ,
4238 } ) ;
4339 expect ( msg ?. data . content ) . toContain ( "line2" ) ;
4440 expect ( msg ?. data . content ) . toContain ( "line4" ) ;
@@ -47,8 +43,7 @@ describe("Built-in Tools", async () => {
4743 it ( "should handle nonexistent file gracefully" , async ( ) => {
4844 const session = await client . createSession ( ) ;
4945 const msg = await session . sendAndWait ( {
50- prompt :
51- "Try to read the file 'does_not_exist.txt'. If it doesn't exist, say 'FILE_NOT_FOUND'." ,
46+ prompt : "Try to read the file 'does_not_exist.txt'. If it doesn't exist, say 'FILE_NOT_FOUND'." ,
5247 } ) ;
5348 expect ( msg ?. data . content ?. toUpperCase ( ) ) . toMatch (
5449 / N O T .F O U N D | N O T .E X I S T | N O .S U C H | F I L E _ N O T _ F O U N D | D O E S .N O T .E X I S T | E R R O R / i
@@ -61,8 +56,7 @@ describe("Built-in Tools", async () => {
6156 await writeFile ( join ( workDir , "edit_me.txt" ) , "Hello World\nGoodbye World\n" ) ;
6257 const session = await client . createSession ( ) ;
6358 const msg = await session . sendAndWait ( {
64- prompt :
65- "Edit the file 'edit_me.txt': replace 'Hello World' with 'Hi Universe'. Then read it back and tell me its contents." ,
59+ prompt : "Edit the file 'edit_me.txt': replace 'Hello World' with 'Hi Universe'. Then read it back and tell me its contents." ,
6660 } ) ;
6761 expect ( msg ?. data . content ) . toContain ( "Hi Universe" ) ;
6862 } ) ;
@@ -72,8 +66,7 @@ describe("Built-in Tools", async () => {
7266 it ( "should create a new file" , async ( ) => {
7367 const session = await client . createSession ( ) ;
7468 const msg = await session . sendAndWait ( {
75- prompt :
76- "Create a file called 'new_file.txt' with the content 'Created by test'. Then read it back to confirm." ,
69+ prompt : "Create a file called 'new_file.txt' with the content 'Created by test'. Then read it back to confirm." ,
7770 } ) ;
7871 expect ( msg ?. data . content ) . toContain ( "Created by test" ) ;
7972 } ) ;
@@ -84,8 +77,7 @@ describe("Built-in Tools", async () => {
8477 await writeFile ( join ( workDir , "data.txt" ) , "apple\nbanana\napricot\ncherry\n" ) ;
8578 const session = await client . createSession ( ) ;
8679 const msg = await session . sendAndWait ( {
87- prompt :
88- "Search for lines starting with 'ap' in the file 'data.txt'. Tell me which lines matched." ,
80+ prompt : "Search for lines starting with 'ap' in the file 'data.txt'. Tell me which lines matched." ,
8981 } ) ;
9082 expect ( msg ?. data . content ) . toContain ( "apple" ) ;
9183 expect ( msg ?. data . content ) . toContain ( "apricot" ) ;
@@ -100,8 +92,7 @@ describe("Built-in Tools", async () => {
10092 await writeFile ( join ( workDir , "README.md" ) , "# Readme" ) ;
10193 const session = await client . createSession ( ) ;
10294 const msg = await session . sendAndWait ( {
103- prompt :
104- "Find all .ts files in this directory (recursively). List the filenames you found." ,
95+ prompt : "Find all .ts files in this directory (recursively). List the filenames you found." ,
10596 } ) ;
10697 expect ( msg ?. data . content ) . toContain ( "app.ts" ) ;
10798 expect ( msg ?. data . content ) . toContain ( "index.ts" ) ;
0 commit comments