Repository navigation
Expand file tree
/
Copy pathpublic_api_test.go
More file actions
49 lines (41 loc) · 2.48 KB
/
Copy pathpublic_api_test.go
File metadata and controls
49 lines (41 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package ledgerforge_test
import (
"testing"
"github.com/hibiken/asynq"
"github.com/devaccuracy/ledgerforge"
"github.com/devaccuracy/ledgerforge/config"
"github.com/devaccuracy/ledgerforge/database"
"github.com/devaccuracy/ledgerforge/model"
)
// These assignments make the established root import path part of the test
// contract while the implementation remains private under internal/core.
var (
_ func(database.IDataSource) (*ledgerforge.LedgerForge, error) = ledgerforge.NewLedgerForge
_ func() *model.BalanceTracker = ledgerforge.NewBalanceTracker
_ func(*config.Configuration, *asynq.Client) *ledgerforge.Queue = ledgerforge.NewQueue
_ func(*model.Transaction) bool = ledgerforge.IsInflightTransaction
_ func(*ledgerforge.LedgerForge) *ledgerforge.LineageOutboxProcessor = ledgerforge.NewLineageOutboxProcessor
_ func(*ledgerforge.LedgerForge) *ledgerforge.QueuedTransactionRecoveryProcessor = ledgerforge.NewQueuedTransactionRecoveryProcessor
)
func TestPublicAPIFacadePreservesLegacyImportPath(t *testing.T) {
t.Parallel()
if ledgerforge.GeneralLedgerID != "general_ledger_id" {
t.Fatalf("GeneralLedgerID changed: %q", ledgerforge.GeneralLedgerID)
}
if _, err := ledgerforge.SQLFiles.Open("sql/1708676327.sql"); err != nil {
t.Fatalf("migration files are not available through the public facade: %v", err)
}
}
// These additions must remain reachable through the stable root facade.
var (
_ func(*ledgerforge.LedgerForge) *ledgerforge.ChainProcessor = ledgerforge.NewChainProcessor
_ func(interface{}) (map[string]interface{}, error) = ledgerforge.DocumentToIndexMap
_ func(error) string = ledgerforge.ClassifyInflightError
_ func(error) bool = ledgerforge.IsDuplicateReferenceError
_ = ledgerforge.IndexTask{}
_ = ledgerforge.RefundOptions{}
_ = ledgerforge.BulkInflightItem{}
_ = ledgerforge.BulkInflightOutcome{}
_ = ledgerforge.BulkTransactionError{}
_ = ledgerforge.InflightActionPayload{}
)