mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user