IT WORKS (again)

This commit is contained in:
Caleb Gardner
2022-06-19 00:32:33 -05:00
parent 8f5e1fef96
commit 214419b5c3
6 changed files with 32 additions and 11 deletions
+14 -4
View File
@@ -3,7 +3,7 @@ package squashfs_test
//Actually proper tests go here.
import (
"fmt"
"errors"
"io"
"io/fs"
"net/http"
@@ -88,12 +88,22 @@ func TestExtractQuick(t *testing.T) {
//TODO: Add long test that checks contents.
squashFils := os.DirFS(unsquashPath)
err = fs.WalkDir(squashFils, "", func(path string, d fs.DirEntry, err error) error {
fmt.Println(path)
err = fs.WalkDir(squashFils, ".", func(path string, d fs.DirEntry, _ error) error {
libFil, e := os.Open(filepath.Join(libPath, path))
if e != nil {
return e
}
stat, _ := d.Info()
libStat, _ := libFil.Stat()
if stat.Size() != libStat.Size() {
t.Log(path, "not the same size between library and unsquashfs")
t.Log("File is", libStat.Size())
t.Log("Should be", stat.Size())
return errors.New("file not the correct size")
}
return nil
})
if err != nil {
t.Fatal(err)
}
t.Fatal("This is a test")
}