test: support windows testing. (#21)

This commit is contained in:
Bo-Yi Wu
2017-01-03 16:59:00 +08:00
committed by GitHub
parent b69d758088
commit 77dbb22aed
4 changed files with 44 additions and 8 deletions
+25
View File
@@ -0,0 +1,25 @@
package main
import "testing"
func TestGetRealPath(t *testing.T) {
type args struct {
path string
}
tests := []struct {
name string
args args
want string
}{
{
"Test Windows Path",
"C:\\Users\\appleboy\\test.txt",
"/C/Users/appleboy/test.txt"
}
}
for _, tt := range tests {
if got := getRealPath(tt.args.path); got != tt.want {
t.Errorf("%q. getRealPath() = %v, want %v", tt.name, got, tt.want)
}
}
}