mirror of
https://github.com/gogs/gogs.git
synced 2025-12-22 16:20:14 +01:00
chore: rename internal/db to internal/database (#7665)
This commit is contained in:
37
internal/database/mirror_test.go
Normal file
37
internal/database/mirror_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright 2017 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package database
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_parseRemoteUpdateOutput(t *testing.T) {
|
||||
tests := []struct {
|
||||
output string
|
||||
expResults []*mirrorSyncResult
|
||||
}{
|
||||
{
|
||||
`
|
||||
From https://try.gogs.io/unknwon/upsteam
|
||||
* [new branch] develop -> develop
|
||||
b0bb24f..1d85a4f master -> master
|
||||
- [deleted] (none) -> bugfix
|
||||
`,
|
||||
[]*mirrorSyncResult{
|
||||
{"develop", gitShortEmptyID, ""},
|
||||
{"master", "b0bb24f", "1d85a4f"},
|
||||
{"bugfix", "", gitShortEmptyID},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run("", func(t *testing.T) {
|
||||
assert.Equal(t, test.expResults, parseRemoteUpdateOutput(test.output))
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user