to multifile always

This commit is contained in:
Bel LaPointe
2023-10-24 12:54:11 -06:00
parent 24d0e829b3
commit 480d358f5a
3 changed files with 34 additions and 16 deletions

View File

@@ -14,7 +14,7 @@ func TestFileTestdata(t *testing.T) {
for _, pathd := range paths {
path := pathd
t.Run(path, func(t *testing.T) {
f, err := NewFile(path)
f, err := NewFiles(path)
if err != nil {
t.Fatal(err)
}
@@ -24,13 +24,19 @@ func TestFileTestdata(t *testing.T) {
if err != nil {
t.Fatal(err)
}
for i := range deltas {
t.Logf("%+v", deltas[i].Debug())
}
})
t.Run("balances", func(t *testing.T) {
balances, err := f.Balances()
deltas, err := f.Deltas()
if err != nil {
t.Fatal(err)
}
balances, err := Balances(deltas)
if err != nil {
t.Fatal(err)
}
@@ -40,7 +46,12 @@ func TestFileTestdata(t *testing.T) {
})
t.Run("balances like", func(t *testing.T) {
balances, err := f.Balances(LikeAcc(`AssetAccount:Cash:Fidelity76`))
deltas, err := f.Deltas(LikeAcc(`AssetAccount:Cash:Fidelity76`))
if err != nil {
t.Fatal(err)
}
balances, err := Balances(deltas)
if err != nil {
t.Fatal(err)
}
@@ -93,7 +104,7 @@ func TestFileDeltas(t *testing.T) {
for name, d := range cases {
want := d
t.Run(name, func(t *testing.T) {
f, err := NewFile("./testdata/" + name + ".dat")
f, err := NewFiles("./testdata/" + name + ".dat")
if err != nil {
t.Fatal(err)
}