-
Notifications
You must be signed in to change notification settings - Fork 0
/
tfs_test.go
50 lines (43 loc) · 1.39 KB
/
tfs_test.go
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
50
package git_tfs_bridge_test
import (
"testing"
bridge "github.com/falconandy/git-tfs-bridge"
"log"
"github.com/sabhiram/go-git-ignore"
)
func TestHistory(t *testing.T) {
tfs, _ := bridge.OpenTfsRepository(`D:\Projects\Sungero\Icons\Kernel`)
log.Println(tfs)
//log.Println(tfs.GetHistoryAfter(100914, false))
//gilog.Println(tfs.GetHistoryFrom(100914, true))
//log.Println(tfs.GetHistory(50000, 100))
}
func TestUpdate(t *testing.T) {
tfs, _ := bridge.OpenTfsRepository(`D:\Projects\Sungero\Main\Common`)
tfs.Update(95000)
tfs.Update(0)
}
func TestTraverseDirectory(t *testing.T) {
gitIgnore, err := ignore.CompileIgnoreFile(`D:\Projects\_sun\Main\.gitignore`)
if err != nil {
log.Println(err)
} else {
bridge.TraverseDirectory(`D:\Projects\_sun\Main\`, gitIgnore, nil)
}
}
func TestCompareDirectory(t *testing.T) {
gitIgnore, _ := ignore.CompileIgnoreFile(`D:\Projects\_sun\Main\.gitignore`)
leftOnly, rightOnly, diffs := bridge.CompareDirectories(`D:\Projects\_sun\Main\Common`, `D:\Projects\Sungero\Main\Common`, gitIgnore, nil)
log.Println(leftOnly)
log.Println(rightOnly)
log.Println(diffs)
}
func TestGetTfsRepositories(t *testing.T) {
tfsRepos, _ := bridge.GetTfsRepositories(`D:\Projects\Sungero\Main`)
for _, repo := range tfsRepos {
log.Println(repo.GetPath())
}
}
func TestToGit(t *testing.T) {
bridge.InitFromTfs(`D:\Projects\_sun\Main`, `D:\Projects\Sungero\Main\`, 101000)
}