@@ -553,6 +553,36 @@ DepGraph end`,
553553 TEST_DISTROLESS_STATIC_IMAGE_DEPGRAPH . pkgs . length ,
554554 ) ;
555555 } ) ;
556+
557+ it ( 'finds go binaries on windows with complex paths' , async ( ) => {
558+ const { code, stdout } = await runSnykCLI (
559+ 'container test test/fixtures/container-projects/go-binaries.tar --json' ,
560+ { env } ,
561+ ) ;
562+
563+ const jsonOutput = JSON . parse ( stdout ) ;
564+
565+ // Should succeed and find Go binaries (including esbuild)
566+ expect ( [ 0 , 1 ] ) . toContain ( code ) ; // 0 = no vulns, 1 = vulns found
567+ expect ( jsonOutput ) . toHaveProperty ( 'applications' ) ;
568+ expect ( jsonOutput . applications ) . toBeInstanceOf ( Array ) ;
569+ expect ( jsonOutput . applications . length ) . toBeGreaterThanOrEqual ( 1 ) ;
570+
571+ // Verify esbuild binary was actually detected by the real container scan
572+ const esbuildApp = jsonOutput . applications . find (
573+ ( app ) => app . targetFile && app . targetFile . includes ( 'esbuild' ) ,
574+ ) ;
575+ expect ( esbuildApp ) . toBeDefined ( ) ;
576+ expect ( esbuildApp . targetFile ) . toBe (
577+ '/app/node_modules/.pnpm/@[email protected] /node_modules/@esbuild/linux-x64/bin/esbuild' , 578+ ) ;
579+
580+ // Verify the complex pnpm path structure is handled correctly
581+ expect ( esbuildApp . targetFile ) . toMatch ( / @ e s b u i l d \+ l i n u x - x 6 4 @ 0 \. 2 3 \. 1 / ) ;
582+ expect ( esbuildApp . targetFile ) . toContain ( '.pnpm' ) ;
583+ expect ( esbuildApp . targetFile ) . toContain ( 'node_modules' ) ;
584+ expect ( esbuildApp . packageManager ) . toBe ( 'gomodules' ) ;
585+ } ) ;
556586 } ) ;
557587
558588 describe ( 'snyk container monitor --json output' , ( ) => {
0 commit comments