code refactor

This commit is contained in:
MaysWind
2025-06-19 22:40:32 +08:00
parent 5dc0e925c1
commit e9c175d2af
12 changed files with 611 additions and 611 deletions
+10 -10
View File
@@ -8,34 +8,34 @@ import (
func TestBeancountAccount_IsOpeningBalanceEquityAccount_True(t *testing.T) {
account := beancountAccount{
accountType: beancountEquityAccountType,
name: "Equity:Opening-Balances",
AccountType: beancountEquityAccountType,
Name: "Equity:Opening-Balances",
}
assert.True(t, account.isOpeningBalanceEquityAccount())
account = beancountAccount{
accountType: beancountEquityAccountType,
name: "E:Opening-Balances",
AccountType: beancountEquityAccountType,
Name: "E:Opening-Balances",
}
assert.True(t, account.isOpeningBalanceEquityAccount())
}
func TestBeancountAccount_IsOpeningBalanceEquityAccount_False(t *testing.T) {
account := beancountAccount{
accountType: beancountAssetsAccountType,
name: "Equity:Opening-Balances",
AccountType: beancountAssetsAccountType,
Name: "Equity:Opening-Balances",
}
assert.False(t, account.isOpeningBalanceEquityAccount())
account = beancountAccount{
accountType: beancountEquityAccountType,
name: "Opening-Balances",
AccountType: beancountEquityAccountType,
Name: "Opening-Balances",
}
assert.False(t, account.isOpeningBalanceEquityAccount())
account = beancountAccount{
accountType: beancountEquityAccountType,
name: "Equity:Other",
AccountType: beancountEquityAccountType,
Name: "Equity:Other",
}
assert.False(t, account.isOpeningBalanceEquityAccount())
}