to multifile always
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user