@@ -28,65 +28,60 @@ suite('Environment Picker Description Logic', () => {
2828 suite ( 'Description formatting with interpreter path' , ( ) => {
2929 test ( 'should use displayPath as description when no original description exists' , ( ) => {
3030 const env = createMockEnvironment ( '/usr/local/bin/python' ) ;
31-
31+
3232 // This is the logic from our updated picker
3333 const pathDescription = env . displayPath ;
34- const description = env . description && env . description . trim ( )
35- ? `${ env . description } (${ pathDescription } )`
36- : pathDescription ;
37-
34+ const description =
35+ env . description && env . description . trim ( ) ? `${ env . description } (${ pathDescription } )` : pathDescription ;
36+
3837 assert . strictEqual ( description , '/usr/local/bin/python' ) ;
3938 } ) ;
4039
4140 test ( 'should append displayPath to existing description in parentheses' , ( ) => {
4241 const env = createMockEnvironment ( '/home/user/.venv/bin/python' , 'Virtual Environment' ) ;
43-
42+
4443 // This is the logic from our updated picker
4544 const pathDescription = env . displayPath ;
46- const description = env . description && env . description . trim ( )
47- ? `${ env . description } (${ pathDescription } )`
48- : pathDescription ;
49-
45+ const description =
46+ env . description && env . description . trim ( ) ? `${ env . description } (${ pathDescription } )` : pathDescription ;
47+
5048 assert . strictEqual ( description , 'Virtual Environment (/home/user/.venv/bin/python)' ) ;
5149 } ) ;
5250
5351 test ( 'should handle complex paths correctly' , ( ) => {
5452 const complexPath = '/usr/local/anaconda3/envs/my-project-env/bin/python' ;
5553 const env = createMockEnvironment ( complexPath , 'Conda Environment' ) ;
56-
54+
5755 // This is the logic from our updated picker
5856 const pathDescription = env . displayPath ;
59- const description = env . description && env . description . trim ( )
60- ? `${ env . description } (${ pathDescription } )`
61- : pathDescription ;
62-
57+ const description =
58+ env . description && env . description . trim ( ) ? `${ env . description } (${ pathDescription } )` : pathDescription ;
59+
6360 assert . strictEqual ( description , `Conda Environment (${ complexPath } )` ) ;
6461 } ) ;
6562
6663 test ( 'should handle empty description correctly' , ( ) => {
6764 const env = createMockEnvironment ( '/opt/python/bin/python' , '' ) ;
68-
69- // This is the logic from our updated picker
65+
66+ // This is the logic from our updated picker
7067 const pathDescription = env . displayPath ;
71- const description = env . description && env . description . trim ( )
72- ? `${ env . description } (${ pathDescription } )`
73- : pathDescription ;
74-
68+ const description =
69+ env . description && env . description . trim ( ) ? `${ env . description } (${ pathDescription } )` : pathDescription ;
70+
7571 // Empty string should be treated like no description, so just use path
7672 assert . strictEqual ( description , '/opt/python/bin/python' ) ;
7773 } ) ;
7874
7975 test ( 'should handle Windows paths correctly' , ( ) => {
8076 const windowsPath = 'C:\\Python39\\python.exe' ;
8177 const env = createMockEnvironment ( windowsPath , 'System Python' ) ;
82-
78+
8379 // This is the logic from our updated picker
8480 const pathDescription = env . displayPath ;
85- const description = env . description && env . description . trim ( )
86- ? `${ env . description } (${ pathDescription } )`
87- : pathDescription ;
88-
81+ const description =
82+ env . description && env . description . trim ( ) ? `${ env . description } (${ pathDescription } )` : pathDescription ;
83+
8984 assert . strictEqual ( description , 'System Python (C:\\Python39\\python.exe)' ) ;
9085 } ) ;
9186 } ) ;
92- } ) ;
87+ } ) ;
0 commit comments