api: Validate the slash variant of a given path

This validates the slash variant of a RelativeDest, rather than the
platform native version, to support test execution on windows.
This commit is contained in:
Danielle Tomlinson
2019-01-10 13:43:51 +01:00
parent 4014ee30ae
commit cf08f85413

View File

@@ -1,6 +1,7 @@
package api
import (
"path/filepath"
"reflect"
"testing"
"time"
@@ -364,7 +365,7 @@ func TestTask_Artifact(t *testing.T) {
if *a.GetterMode != "file" {
t.Errorf("expected file but found %q", *a.GetterMode)
}
if *a.RelativeDest != "local/foo.txt" {
if filepath.ToSlash(*a.RelativeDest) != "local/foo.txt" {
t.Errorf("expected local/foo.txt but found %q", *a.RelativeDest)
}
}