dates can be strings i dont care

This commit is contained in:
Bel LaPointe
2023-10-24 06:19:26 -06:00
parent 459bc54760
commit 392036f2b0
4 changed files with 43 additions and 30 deletions

View File

@@ -5,35 +5,30 @@ import (
"io"
"strings"
"testing"
"time"
)
func TestFileDeltas(t *testing.T) {
d := func(s string) time.Time {
v, _ := time.Parse("2006-01-02", s)
return v
}
happy := []Delta{
{
Date: d("2022-12-12"),
Date: "2022-12-12",
Account: "AssetAccount:Cash:Fidelity76",
Value: -97.92,
Currency: USD,
},
{
Date: d("2022-12-12"),
Date: "2022-12-12",
Account: "Withdrawal:0:SharedHome:DominionEnergy",
Value: 97.92,
Currency: USD,
},
{
Date: d("2022-12-12"),
Date: "2022-12-12",
Account: "AssetAccount:Cash:Fidelity76",
Value: -1.00,
Currency: USD,
},
{
Date: d("2022-12-12"),
Date: "2022-12-12",
Account: "Debts:Credit:ChaseFreedomUltdVisa",
Value: 1.00,
Currency: USD,
@@ -75,10 +70,6 @@ func TestFileDeltas(t *testing.T) {
}
func TestReadTransaction(t *testing.T) {
d := func(s string) time.Time {
v, _ := time.Parse("2006-01-02", s)
return v
}
cases := map[string]struct {
input string
want transaction
@@ -101,7 +92,7 @@ func TestReadTransaction(t *testing.T) {
C:D $-1.00
`,
want: transaction{
date: d("2003-04-05"),
date: "2003-04-05",
description: "Reasoning here",
payee: "",
recipients: []transactionRecipient{