summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cache/cache_test.go11
-rw-r--r--main.go2
2 files changed, 6 insertions, 7 deletions
diff --git a/cache/cache_test.go b/cache/cache_test.go
index 95ded9d..ecf07f5 100644
--- a/cache/cache_test.go
+++ b/cache/cache_test.go
@@ -130,10 +130,10 @@ func TestMerge(t *testing.T) {
Path: "/new/mypath",
Label: "mypath",
}
- base := Cache{Entries: []Entry{
+ base := &Cache{Entries: []Entry{
a, b,
}}
- other := Cache{Entries: []Entry{
+ other := &Cache{Entries: []Entry{
b, c,
}}
result := base.Merge(other)
@@ -162,7 +162,7 @@ func TestNew(t *testing.T) {
func TestLoadFile_NotExist(t *testing.T) {
f := fstest.MapFS{}
c, err := LoadFile(f, "anything is fine")
- assert.Nil(t, c.Entries)
+ assert.Nil(t, c)
assert.NoError(t, err)
}
@@ -170,8 +170,7 @@ func TestLoadFile_NotExist(t *testing.T) {
func TestSaveFile(t *testing.T) {
dir := t.TempDir()
loc := filepath.Join(dir, "savefile")
- st := TState(TSource("source_one", "target"), TSource("second_source", "t1", "t2", "t3"))
- c := Cache{Entries: []Entry{
+ c := &Cache{Entries: []Entry{
{
Path: "path",
Label: "label",
@@ -181,6 +180,6 @@ func TestSaveFile(t *testing.T) {
Label: "",
},
}}
- err := SaveFile(loc, st, c)
+ err := SaveFile(loc, c)
assert.NoError(t, err)
}
diff --git a/main.go b/main.go
index ff7fc9e..ebf3a15 100644
--- a/main.go
+++ b/main.go
@@ -140,7 +140,7 @@ func main() {
if *flags.List {
for _, s := range st.Sources {
for _, t := range s.Targets {
- _, _ = spool.Print(t.ShortestId() + paths.Ifs)
+ _, _ = spool.Print("%v\n", t.ShortestId()+paths.Ifs)
}
}
os.Exit(0)