remove pocketbase imports from ghupdate

This commit is contained in:
henrygd
2025-08-25 21:16:43 -04:00
parent 20ca6edf81
commit 0b0e94e045
3 changed files with 167 additions and 64 deletions

View File

@@ -1,6 +1,9 @@
package ghupdate
import "testing"
import (
"path/filepath"
"testing"
)
func TestReleaseFindAssetBySuffix(t *testing.T) {
r := release{
@@ -21,3 +24,22 @@ func TestReleaseFindAssetBySuffix(t *testing.T) {
t.Fatalf("Expected asset with id %d, got %v", 2, asset)
}
}
func TestExtractFailure(t *testing.T) {
testDir := t.TempDir()
// Test with missing zip file
missingZipPath := filepath.Join(testDir, "missing_test.zip")
extractedPath := filepath.Join(testDir, "zip_extract")
if err := extract(missingZipPath, extractedPath); err == nil {
t.Fatal("Expected Extract to fail due to missing zip file")
}
// Test with missing tar.gz file
missingTarPath := filepath.Join(testDir, "missing_test.tar.gz")
if err := extract(missingTarPath, extractedPath); err == nil {
t.Fatal("Expected Extract to fail due to missing tar.gz file")
}
}