A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/orgrim/pg_back/commit/bd70543edae4935a960b6a52da42b7009b333213 below:

fix unit tests on windows · orgrim/pg_back@bd70543 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+14

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+14

-0

lines changed Original file line number Diff line number Diff line change

@@ -4,6 +4,7 @@ import (

4 4

"fmt"

5 5

"os/user"

6 6

"path/filepath"

7 +

"runtime"

7 8

"testing"

8 9

)

9 10

@@ -24,6 +25,19 @@ func TestExpandHomeDir(t *testing.T) {

24 25

{fmt.Sprintf("~%s/truc/muche", u.Username), filepath.Clean(filepath.Join(u.HomeDir, "/truc/muche"))},

25 26

}

26 27 28 +

if runtime.GOOS == "windows" {

29 +

tests = []struct {

30 +

input string

31 +

want string

32 +

}{

33 +

{"", "."},

34 +

{"/truc/truc/../muche", "\\truc\\muche"},

35 +

{"./truc/muche", "truc\\muche"},

36 +

{"~/truc/muche/dir", filepath.Clean(filepath.Join(u.HomeDir, "/truc/muche/dir"))},

37 +

{fmt.Sprintf("~%s/truc/muche", u.Username), filepath.Clean(filepath.Join(u.HomeDir, "/truc/muche"))},

38 +

}

39 +

}

40 + 27 41

for i, st := range tests {

28 42

t.Run(fmt.Sprintf("%v", i), func(t *testing.T) {

29 43

got, err := expandHomeDir(st.input)

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4