@@ -11,61 +11,61 @@ suite('Execute Strategy - Prompt Detection', () => {
11
11
ensureNoDisposablesAreLeakedInTestSuite ( ) ;
12
12
13
13
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 ) ;
17
17
} ) ;
18
18
19
19
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 ) ;
23
23
} ) ;
24
24
25
25
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 ) ;
29
29
} ) ;
30
30
31
31
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 ) ;
35
35
} ) ;
36
36
37
37
test ( 'detectsCommonPromptPattern should detect Python REPL' , ( ) => {
38
- strictEqual ( detectsCommonPromptPattern ( '>>> ' ) , true ) ;
39
- strictEqual ( detectsCommonPromptPattern ( '>>>' ) , true ) ;
38
+ strictEqual ( detectsCommonPromptPattern ( '>>> ' ) . detected , true ) ;
39
+ strictEqual ( detectsCommonPromptPattern ( '>>>' ) . detected , true ) ;
40
40
} ) ;
41
41
42
42
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 ) ;
45
45
} ) ;
46
46
47
47
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 ) ;
50
50
} ) ;
51
51
52
52
test ( 'detectsCommonPromptPattern should handle multiline content' , ( ) => {
53
53
const multilineContent = `command output line 1
54
54
command output line 2
55
55
user@host:~$ ` ;
56
- strictEqual ( detectsCommonPromptPattern ( multilineContent ) , true ) ;
56
+ strictEqual ( detectsCommonPromptPattern ( multilineContent ) . detected , true ) ;
57
57
} ) ;
58
58
59
59
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 ) ;
64
64
} ) ;
65
65
66
66
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
70
70
} ) ;
71
- } ) ;
71
+ } ) ;
0 commit comments