delta.Transaction export field
parent
666965042a
commit
ddc95c9054
|
|
@ -15,7 +15,7 @@ type Delta struct {
|
|||
Currency Currency
|
||||
Description string
|
||||
isSet bool
|
||||
transaction string
|
||||
Transaction string
|
||||
}
|
||||
|
||||
func newDelta(transaction string, d, desc, name string, v float64, c string, isSet bool) Delta {
|
||||
|
|
@ -26,7 +26,7 @@ func newDelta(transaction string, d, desc, name string, v float64, c string, isS
|
|||
Currency: Currency(c),
|
||||
Description: desc,
|
||||
isSet: isSet,
|
||||
transaction: transaction,
|
||||
Transaction: transaction,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ func TestDelta(t *testing.T) {
|
|||
d := "2099-08-07"
|
||||
delta := newDelta("x", d, "", "name", 34.56, "$", false)
|
||||
|
||||
if delta.transaction != "x" {
|
||||
t.Error(delta.transaction)
|
||||
if delta.Transaction != "x" {
|
||||
t.Error(delta.Transaction)
|
||||
}
|
||||
if delta.Date != d {
|
||||
t.Error(delta.Date)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ func (files Files) Amend(old, now Delta) error {
|
|||
|
||||
var transaction transaction
|
||||
for _, xaction := range xactions {
|
||||
if xaction.name != old.transaction {
|
||||
if xaction.name != old.Transaction {
|
||||
continue
|
||||
}
|
||||
transaction = xaction
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ func TestFileAmend(t *testing.T) {
|
|||
} else if deltas, err := files.Deltas(); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if filtered := deltas.Like(func(d Delta) bool {
|
||||
c.old.transaction = d.transaction
|
||||
c.old.Transaction = d.Transaction
|
||||
return d == c.old
|
||||
}); len(filtered) != 1 {
|
||||
t.Fatalf("input %s didnt include old %+v in %+v", c.from, c.old, deltas)
|
||||
|
|
@ -424,10 +424,10 @@ func TestFileDeltas(t *testing.T) {
|
|||
if i >= len(deltas) {
|
||||
break
|
||||
}
|
||||
if deltas[i].transaction == "" {
|
||||
t.Error(deltas[i].transaction)
|
||||
if deltas[i].Transaction == "" {
|
||||
t.Error(deltas[i].Transaction)
|
||||
}
|
||||
deltas[i].transaction = ""
|
||||
deltas[i].Transaction = ""
|
||||
if want[i] != deltas[i] {
|
||||
t.Errorf("[%d] \n\twant=%s, \n\t got=%s", i, want[i].Debug(), deltas[i].Debug())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ type Likes []Like
|
|||
|
||||
func LikeTransaction(delta Delta) Like {
|
||||
return func(d Delta) bool {
|
||||
return d.transaction == delta.transaction
|
||||
return d.Transaction == delta.Transaction
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue