@@ -11,61 +11,61 @@ suite('Execute Strategy - Prompt Detection', () => {
1111 ensureNoDisposablesAreLeakedInTestSuite ( ) ;
1212
1313 test ( 'detectsCommonPromptPattern should detect PowerShell prompts' , ( ) => {
14- strictEqual ( detectsCommonPromptPattern ( 'PS C:\\>' ) , true ) ;
15- strictEqual ( detectsCommonPromptPattern ( 'PS C:\\Windows\\System32>' ) , true ) ;
16- strictEqual ( detectsCommonPromptPattern ( 'PS C:\\Users\\test> ' ) , true ) ;
14+ strictEqual ( detectsCommonPromptPattern ( 'PS C:\\>' ) . detected , true ) ;
15+ strictEqual ( detectsCommonPromptPattern ( 'PS C:\\Windows\\System32>' ) . detected , true ) ;
16+ strictEqual ( detectsCommonPromptPattern ( 'PS C:\\Users\\test> ' ) . detected , true ) ;
1717 } ) ;
1818
1919 test ( 'detectsCommonPromptPattern should detect Command Prompt' , ( ) => {
20- strictEqual ( detectsCommonPromptPattern ( 'C:\\>' ) , true ) ;
21- strictEqual ( detectsCommonPromptPattern ( 'C:\\Windows\\System32>' ) , true ) ;
22- strictEqual ( detectsCommonPromptPattern ( 'D:\\test> ' ) , true ) ;
20+ strictEqual ( detectsCommonPromptPattern ( 'C:\\>' ) . detected , true ) ;
21+ strictEqual ( detectsCommonPromptPattern ( 'C:\\Windows\\System32>' ) . detected , true ) ;
22+ strictEqual ( detectsCommonPromptPattern ( 'D:\\test> ' ) . detected , true ) ;
2323 } ) ;
2424
2525 test ( 'detectsCommonPromptPattern should detect Bash prompts' , ( ) => {
26- strictEqual ( detectsCommonPromptPattern ( 'user@host:~$ ' ) , true ) ;
27- strictEqual ( detectsCommonPromptPattern ( '$ ' ) , true ) ;
28- strictEqual ( detectsCommonPromptPattern ( '[user@host ~]$ ' ) , true ) ;
26+ strictEqual ( detectsCommonPromptPattern ( 'user@host:~$ ' ) . detected , true ) ;
27+ strictEqual ( detectsCommonPromptPattern ( '$ ' ) . detected , true ) ;
28+ strictEqual ( detectsCommonPromptPattern ( '[user@host ~]$ ' ) . detected , true ) ;
2929 } ) ;
3030
3131 test ( 'detectsCommonPromptPattern should detect root prompts' , ( ) => {
32- strictEqual ( detectsCommonPromptPattern ( 'root@host:~# ' ) , true ) ;
33- strictEqual ( detectsCommonPromptPattern ( '# ' ) , true ) ;
34- strictEqual ( detectsCommonPromptPattern ( '[root@host ~]# ' ) , true ) ;
32+ strictEqual ( detectsCommonPromptPattern ( 'root@host:~# ' ) . detected , true ) ;
33+ strictEqual ( detectsCommonPromptPattern ( '# ' ) . detected , true ) ;
34+ strictEqual ( detectsCommonPromptPattern ( '[root@host ~]# ' ) . detected , true ) ;
3535 } ) ;
3636
3737 test ( 'detectsCommonPromptPattern should detect Python REPL' , ( ) => {
38- strictEqual ( detectsCommonPromptPattern ( '>>> ' ) , true ) ;
39- strictEqual ( detectsCommonPromptPattern ( '>>>' ) , true ) ;
38+ strictEqual ( detectsCommonPromptPattern ( '>>> ' ) . detected , true ) ;
39+ strictEqual ( detectsCommonPromptPattern ( '>>>' ) . detected , true ) ;
4040 } ) ;
4141
4242 test ( 'detectsCommonPromptPattern should detect starship prompts' , ( ) => {
43- strictEqual ( detectsCommonPromptPattern ( '~ ❯ ' ) , true ) ;
44- strictEqual ( detectsCommonPromptPattern ( '/path/to/project ❯' ) , true ) ;
43+ strictEqual ( detectsCommonPromptPattern ( '~ \u276f ' ) . detected , true ) ;
44+ strictEqual ( detectsCommonPromptPattern ( '/path/to/project \u276f' ) . detected , true ) ;
4545 } ) ;
4646
4747 test ( 'detectsCommonPromptPattern should detect generic prompts' , ( ) => {
48- strictEqual ( detectsCommonPromptPattern ( 'test> ' ) , true ) ;
49- strictEqual ( detectsCommonPromptPattern ( 'someprompt% ' ) , true ) ;
48+ strictEqual ( detectsCommonPromptPattern ( 'test> ' ) . detected , true ) ;
49+ strictEqual ( detectsCommonPromptPattern ( 'someprompt% ' ) . detected , true ) ;
5050 } ) ;
5151
5252 test ( 'detectsCommonPromptPattern should handle multiline content' , ( ) => {
5353 const multilineContent = `command output line 1
5454command output line 2
5555user@host:~$ ` ;
56- strictEqual ( detectsCommonPromptPattern ( multilineContent ) , true ) ;
56+ strictEqual ( detectsCommonPromptPattern ( multilineContent ) . detected , true ) ;
5757 } ) ;
5858
5959 test ( 'detectsCommonPromptPattern should reject non-prompt content' , ( ) => {
60- strictEqual ( detectsCommonPromptPattern ( 'just some output' ) , false ) ;
61- strictEqual ( detectsCommonPromptPattern ( 'error: command not found' ) , false ) ;
62- strictEqual ( detectsCommonPromptPattern ( '' ) , false ) ;
63- strictEqual ( detectsCommonPromptPattern ( ' ' ) , false ) ;
60+ strictEqual ( detectsCommonPromptPattern ( 'just some output' ) . detected , false ) ;
61+ strictEqual ( detectsCommonPromptPattern ( 'error: command not found' ) . detected , false ) ;
62+ strictEqual ( detectsCommonPromptPattern ( '' ) . detected , false ) ;
63+ strictEqual ( detectsCommonPromptPattern ( ' ' ) . detected , false ) ;
6464 } ) ;
6565
6666 test ( 'detectsCommonPromptPattern should handle edge cases' , ( ) => {
67- strictEqual ( detectsCommonPromptPattern ( 'output\n\n\n' ) , false ) ;
68- strictEqual ( detectsCommonPromptPattern ( '\n\n$ \n\n' ) , true ) ; // prompt with surrounding whitespace
69- strictEqual ( detectsCommonPromptPattern ( 'output\nPS C:\\> ' ) , true ) ; // prompt at end after output
67+ strictEqual ( detectsCommonPromptPattern ( 'output\n\n\n' ) . detected , false ) ;
68+ strictEqual ( detectsCommonPromptPattern ( '\n\n$ \n\n' ) . detected , true ) ; // prompt with surrounding whitespace
69+ strictEqual ( detectsCommonPromptPattern ( 'output\nPS C:\\> ' ) . detected , true ) ; // prompt at end after output
7070 } ) ;
71- } ) ;
71+ } ) ;
0 commit comments