feat(gl): detect duplicate transaction versions
This commit is contained in:
@@ -41,3 +41,16 @@ func TestRunScansAndReportsInvalidJournals(t *testing.T) {
|
||||
t.Fatalf("unexpected report: %+v", report)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunReportsDuplicateTransactionVersions(t *testing.T) {
|
||||
first := validJournal()
|
||||
second := validJournal()
|
||||
second.ID = "j2"
|
||||
report, err := Run(context.Background(), repositoryStub{pages: [][]ledger.Journal{{first, second}}}, 10)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if report.Valid != 1 || len(report.Invalid) != 1 {
|
||||
t.Fatalf("unexpected report: %+v", report)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user