Commit 1b0f2b47 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge pull request #2227 from ceh/pp-atlas-util-test-fix

post-processor/atlas: adjust test for cross-platform filepath separator
parents 1e853f9f 1999c83a
package atlas package atlas
import ( import (
"path/filepath"
"testing" "testing"
) )
func TestLongestCommonPrefix(t *testing.T) { func TestLongestCommonPrefix(t *testing.T) {
sep := string(filepath.Separator)
cases := []struct { cases := []struct {
Input []string Input []string
Output string Output string
...@@ -18,12 +20,12 @@ func TestLongestCommonPrefix(t *testing.T) { ...@@ -18,12 +20,12 @@ func TestLongestCommonPrefix(t *testing.T) {
"", "",
}, },
{ {
[]string{"foo/", "foo/bar"}, []string{"foo" + sep, "foo" + sep + "bar"},
"foo/", "foo" + sep,
}, },
{ {
[]string{"/foo/", "/bar"}, []string{sep + "foo" + sep, sep + "bar"},
"/", sep,
}, },
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment