mirror of
https://github.com/hashicorp/packer.git
synced 2026-10-13 17:52:10 -04:00
Merge pull request #2227 from ceh/pp-atlas-util-test-fix
post-processor/atlas: adjust test for cross-platform filepath separator
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package atlas
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLongestCommonPrefix(t *testing.T) {
|
||||
sep := string(filepath.Separator)
|
||||
cases := []struct {
|
||||
Input []string
|
||||
Output string
|
||||
@@ -18,12 +20,12 @@ func TestLongestCommonPrefix(t *testing.T) {
|
||||
"",
|
||||
},
|
||||
{
|
||||
[]string{"foo/", "foo/bar"},
|
||||
"foo/",
|
||||
[]string{"foo" + sep, "foo" + sep + "bar"},
|
||||
"foo" + sep,
|
||||
},
|
||||
{
|
||||
[]string{"/foo/", "/bar"},
|
||||
"/",
|
||||
[]string{sep + "foo" + sep, sep + "bar"},
|
||||
sep,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user