aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-20 22:56:41 +0800
committerGravatar Runxi Yu2026-02-20 22:56:41 +0800
commitc133c9d5c7afc8bb1b0892b028a9490f767e6c79 (patch)
treeb4edb820879e4f13c28e4b876b82aa2a1ebc6a2c
parentobjectid: Rename from oid (diff)
signatureNo signature
config: Use _test package for tests
-rw-r--r--config/config_test.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/config/config_test.go b/config/config_test.go
index eadd4d86..8eb2a468 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -1,4 +1,4 @@
-package config
+package config_test
import (
"os"
@@ -6,6 +6,7 @@ import (
"strings"
"testing"
+ "codeberg.org/lindenii/furgit/config"
"codeberg.org/lindenii/furgit/internal/testgit"
"codeberg.org/lindenii/furgit/objectid"
)
@@ -35,7 +36,7 @@ func TestConfigAgainstGit(t *testing.T) {
cfgFile := openConfig(t, repo)
defer func() { _ = cfgFile.Close() }()
- cfg, err := ParseConfig(cfgFile)
+ cfg, err := config.ParseConfig(cfgFile)
if err != nil {
t.Fatalf("ParseConfig failed: %v", err)
}
@@ -64,7 +65,7 @@ func TestConfigSubsectionAgainstGit(t *testing.T) {
cfgFile := openConfig(t, repo)
defer func() { _ = cfgFile.Close() }()
- cfg, err := ParseConfig(cfgFile)
+ cfg, err := config.ParseConfig(cfgFile)
if err != nil {
t.Fatalf("ParseConfig failed: %v", err)
}
@@ -88,7 +89,7 @@ func TestConfigMultiValueAgainstGit(t *testing.T) {
cfgFile := openConfig(t, repo)
defer func() { _ = cfgFile.Close() }()
- cfg, err := ParseConfig(cfgFile)
+ cfg, err := config.ParseConfig(cfgFile)
if err != nil {
t.Fatalf("ParseConfig failed: %v", err)
}
@@ -123,7 +124,7 @@ func TestConfigCaseInsensitiveAgainstGit(t *testing.T) {
cfgFile := openConfig(t, repo)
defer func() { _ = cfgFile.Close() }()
- cfg, err := ParseConfig(cfgFile)
+ cfg, err := config.ParseConfig(cfgFile)
if err != nil {
t.Fatalf("ParseConfig failed: %v", err)
}
@@ -151,7 +152,7 @@ func TestConfigBooleanAgainstGit(t *testing.T) {
cfgFile := openConfig(t, repo)
defer func() { _ = cfgFile.Close() }()
- cfg, err := ParseConfig(cfgFile)
+ cfg, err := config.ParseConfig(cfgFile)
if err != nil {
t.Fatalf("ParseConfig failed: %v", err)
}
@@ -185,7 +186,7 @@ func TestConfigComplexValuesAgainstGit(t *testing.T) {
cfgFile := openConfig(t, repo)
defer func() { _ = cfgFile.Close() }()
- cfg, err := ParseConfig(cfgFile)
+ cfg, err := config.ParseConfig(cfgFile)
if err != nil {
t.Fatalf("ParseConfig failed: %v", err)
}
@@ -210,7 +211,7 @@ func TestConfigEntriesAgainstGit(t *testing.T) {
cfgFile := openConfig(t, repo)
defer func() { _ = cfgFile.Close() }()
- cfg, err := ParseConfig(cfgFile)
+ cfg, err := config.ParseConfig(cfgFile)
if err != nil {
t.Fatalf("ParseConfig failed: %v", err)
}
@@ -266,7 +267,7 @@ func TestConfigErrorCases(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
r := strings.NewReader(tt.config)
- _, err := ParseConfig(r)
+ _, err := config.ParseConfig(r)
if err == nil {
t.Errorf("expected error for %s", tt.name)
}