Skip to content

Commit

Permalink
test: remove WriteDB tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornplusplus committed Apr 19, 2024
1 parent 06cc866 commit 1aa263d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 204 deletions.
22 changes: 22 additions & 0 deletions cmd/chisel/cmd_cut_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"regexp"
"strings"

"github.com/klauspost/compress/zstd"
. "gopkg.in/check.v1"

chisel "github.com/canonical/chisel/cmd/chisel"
Expand Down Expand Up @@ -536,3 +537,24 @@ func fakeOpenArchive(f func(opts *archive.Options) (archive.Archive, error)) (re
chisel.OpenArchive = f
return func() { chisel.OpenArchive = old }
}

// Extract a zstd-compressed file "src" at path "dest"
func extractZSTD(path string) (string, error) {
file, err := os.Open(path)
if err != nil {
return "", err
}
defer file.Close()

reader, err := zstd.NewReader(file)
if err != nil {
return "", err
}
defer reader.Close()

bytes, err := io.ReadAll(reader)
if err != nil {
return "", err
}
return string(bytes), nil
}
195 changes: 0 additions & 195 deletions cmd/chisel/db_test.go

This file was deleted.

9 changes: 0 additions & 9 deletions cmd/chisel/export_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
package main

var (
WriteDB = writeDB
)

type DBPackage dbPackage
type DBSlice dbSlice
type DBPath dbPath
type DBContent dbContent

func FakeIsStdoutTTY(t bool) (restore func()) {
oldIsStdoutTTY := isStdoutTTY
isStdoutTTY = t
Expand Down

0 comments on commit 1aa263d

Please sign in to comment.