@@ -106,6 +106,28 @@ func TestAddPack(t *testing.T) {
106106 checkPackIsInstalled (t , packInfoToType (packToReinstall ))
107107 })
108108
109+ t .Run ("test installing downloaded pack" , func (t * testing.T ) {
110+ localTestingDir := "test-add-downloaded-pack"
111+ assert .Nil (installer .SetPackRoot (localTestingDir , CreatePackRoot ))
112+ installer .UnlockPackRoot ()
113+ defer removePackRoot (localTestingDir )
114+
115+ packPath := packToReinstall
116+ addPack (t , packPath , ConfigType {})
117+ removePack (t , packPath , true , true , false )
118+ packPath = filepath .Join (installer .Installation .DownloadDir , packToReinstallFileName )
119+ err := installer .AddPack (packPath , ! CheckEula , ! ExtractEula , ! ForceReinstall , ! NoRequirements , Timeout )
120+ assert .Nil (err )
121+
122+ // ensure downloaded pack remains valid
123+ err = installer .AddPack (packPath , ! CheckEula , ! ExtractEula , ForceReinstall , ! NoRequirements , Timeout )
124+ assert .Nil (err )
125+
126+ packToReinstall , err := utils .ExtractPackInfo (packPath )
127+ assert .Nil (err )
128+ checkPackIsInstalled (t , packInfoToType (packToReinstall ))
129+ })
130+
109131 t .Run ("test force-reinstalling an installed pack using encoded progress" , func (t * testing.T ) {
110132 localTestingDir := "test-add-pack-force-reinstall-already-installed-using-encoded-progress"
111133 assert .Nil (installer .SetPackRoot (localTestingDir , CreatePackRoot ))
0 commit comments