(t *testing.T)
| 127 | } |
| 128 | |
| 129 | func TestBackupTarWithDeps_GzipTempDirEmptyReturnsError(t *testing.T) { |
| 130 | t.Parallel() |
| 131 | |
| 132 | deps := backupTarDeps{ |
| 133 | tempDir: func() string { return "" }, |
| 134 | export: func(distributionName, destFileName string) error { |
| 135 | t.Fatal("export should not be called when temp dir is empty") |
| 136 | return nil |
| 137 | }, |
| 138 | copyFile: func(srcPath, destPath string, compress bool) error { |
| 139 | t.Fatal("copyFile should not be called when temp dir is empty") |
| 140 | return nil |
| 141 | }, |
| 142 | remove: func(path string) error { return nil }, |
| 143 | randIntn: func(n int) int { return 0 }, |
| 144 | } |
| 145 | |
| 146 | err := backupTarWithDeps("Arch", "backup.tar.gz", deps) |
| 147 | if err == nil { |
| 148 | t.Fatal("backupTarWithDeps succeeded unexpectedly") |
| 149 | } |
| 150 | if err.Error() != "failed to create temp directory" { |
| 151 | t.Fatalf("error = %q, want %q", err.Error(), "failed to create temp directory") |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | func TestBackupExt4Vhdx_GetProfileError(t *testing.T) { |
| 156 | t.Parallel() |
nothing calls this directly
no test coverage detected