@@ -106,6 +106,47 @@ func TestInstall(t *testing.T) {
106106 t .Setenv ("PATH" , bin + string (os .PathListSeparator )+ os .Getenv ("PATH" ))
107107 },
108108 },
109+ {
110+ name : "with composer, pip, and pnpm tools" ,
111+ tools : & config.Tools {
112+ Composer : []* config.ComposerTool {
113+ {
114+ Name : "fake-composer-tool" ,
115+ Version : "1.0.0" ,
116+ Repo : "github.com/fake/fake-tool" ,
117+ SHA256 : "29635b02c6e505fe31cba2f88ae999f00d2710fe1d65cb7cad521a82e7c5a518" ,
118+ },
119+ },
120+ Pip : []* config.PipTool {
121+ {
122+ Name : "fake-pip-tool" ,
123+ Version : "2.0.0" ,
124+ },
125+ },
126+ PNPM : []* config.PNPMTool {
127+ {
128+ Name : "fake-pnpm-tool" ,
129+ Version : "3.0.0" ,
130+ },
131+ },
132+ },
133+ setup : func (t * testing.T ) {
134+ cache := t .TempDir ()
135+ t .Setenv ("LIBRARIAN_CACHE" , cache )
136+ t .Setenv ("LIBRARIAN_BIN" , filepath .Join (cache , "bin" ))
137+ repoDir := filepath .Join (cache , "github.com/fake/fake-tool@1.0.0" )
138+ if err := os .MkdirAll (filepath .Join (repoDir , "dummy" ), 0o755 ); err != nil {
139+ t .Fatal (err )
140+ }
141+
142+ bin := t .TempDir ()
143+ writeExecutable (t , filepath .Join (bin , "composer" ), "#!/bin/sh\n exit 0\n " )
144+ writeExecutable (t , filepath .Join (bin , "pip" ), "#!/bin/sh\n exit 0\n " )
145+ writeExecutable (t , filepath .Join (bin , "node" ), "#!/bin/sh\n exit 0\n " )
146+ writeExecutable (t , filepath .Join (bin , "pnpm" ), "#!/bin/sh\n exit 0\n " )
147+ t .Setenv ("PATH" , bin + string (os .PathListSeparator )+ os .Getenv ("PATH" ))
148+ },
149+ },
109150 } {
110151 t .Run (test .name , func (t * testing.T ) {
111152 if test .setup != nil {
0 commit comments