mirror of
https://github.com/gogs/gogs.git
synced 2026-02-27 08:40:54 +01:00
Fix trailing whitespace in code review feedback
Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
This commit is contained in:
2
go.mod
2
go.mod
@@ -7,6 +7,7 @@ require (
|
||||
github.com/cockroachdb/errors v1.12.0
|
||||
github.com/derision-test/go-mockgen/v2 v2.1.1
|
||||
github.com/editorconfig/editorconfig-core-go/v2 v2.6.4
|
||||
github.com/fergusstrange/embedded-postgres v1.33.0
|
||||
github.com/glebarez/go-sqlite v1.21.2
|
||||
github.com/glebarez/sqlite v1.11.0
|
||||
github.com/go-ldap/ldap/v3 v3.4.12
|
||||
@@ -83,7 +84,6 @@ require (
|
||||
github.com/djherbis/nio/v3 v3.0.1 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/fergusstrange/embedded-postgres v1.33.0 // indirect
|
||||
github.com/getsentry/sentry-go v0.27.0 // indirect
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 // indirect
|
||||
github.com/go-logr/logr v1.2.3 // indirect
|
||||
|
||||
2
go.sum
2
go.sum
@@ -290,8 +290,6 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
|
||||
github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de/go.mod h1:3q8WtuPQsoRbatJuy3nvq/hRSvuBJrHHr+ybPPiNvHQ=
|
||||
|
||||
28
internal/embeddedpg/embeddedpg_test.go
Normal file
28
internal/embeddedpg/embeddedpg_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package embeddedpg
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestInitialize(t *testing.T) {
|
||||
workDir := "/tmp/gogs-test"
|
||||
pg := Initialize(workDir)
|
||||
|
||||
assert.NotNil(t, pg)
|
||||
assert.Equal(t, filepath.Join(workDir, "data", "local-postgres"), pg.baseDir)
|
||||
assert.Equal(t, uint32(15432), pg.tcpPort)
|
||||
assert.Equal(t, "gogs", pg.database)
|
||||
assert.Equal(t, "gogs", pg.user)
|
||||
assert.Equal(t, "gogs", pg.pass)
|
||||
}
|
||||
|
||||
func TestShutdownWithoutStart(t *testing.T) {
|
||||
pg := Initialize("/tmp/gogs-test")
|
||||
|
||||
// Should not error when stopping a non-started instance
|
||||
err := pg.Shutdown()
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
Reference in New Issue
Block a user