11package processors
22
33import (
4+ "path/filepath"
45 "testing"
56
67 "github.com/stretchr/testify/assert"
@@ -39,11 +40,11 @@ func TestExclusionPaths_Process(t *testing.T) {
3940 desc : "begin with word" ,
4041 patterns : []string {"^foo" },
4142 issues : []result.Issue {
42- {RelativePath : "foo.go" },
43- {RelativePath : "foo/foo.go" },
44- {RelativePath : "foo/bar.go" },
45- {RelativePath : "bar/foo.go" },
46- {RelativePath : "bar/bar.go" },
43+ {RelativePath : filepath . FromSlash ( "foo.go" ) },
44+ {RelativePath : filepath . FromSlash ( "foo/foo.go" ) },
45+ {RelativePath : filepath . FromSlash ( "foo/bar.go" ) },
46+ {RelativePath : filepath . FromSlash ( "bar/foo.go" ) },
47+ {RelativePath : filepath . FromSlash ( "bar/bar.go" ) },
4748 },
4849 expected : []result.Issue {
4950 {RelativePath : "bar/foo.go" },
@@ -54,36 +55,36 @@ func TestExclusionPaths_Process(t *testing.T) {
5455 desc : "directory begin with word" ,
5556 patterns : []string {"^foo/" },
5657 issues : []result.Issue {
57- {RelativePath : "foo.go" },
58- {RelativePath : "foo/foo.go" },
59- {RelativePath : "foo/bar.go" },
60- {RelativePath : "bar/foo.go" },
61- {RelativePath : "bar/bar.go" },
58+ {RelativePath : filepath . FromSlash ( "foo.go" ) },
59+ {RelativePath : filepath . FromSlash ( "foo/foo.go" ) },
60+ {RelativePath : filepath . FromSlash ( "foo/bar.go" ) },
61+ {RelativePath : filepath . FromSlash ( "bar/foo.go" ) },
62+ {RelativePath : filepath . FromSlash ( "bar/bar.go" ) },
6263 },
6364 expected : []result.Issue {
64- {RelativePath : "foo.go" },
65- {RelativePath : "bar/foo.go" },
66- {RelativePath : "bar/bar.go" },
65+ {RelativePath : filepath . FromSlash ( "foo.go" ) },
66+ {RelativePath : filepath . FromSlash ( "bar/foo.go" ) },
67+ {RelativePath : filepath . FromSlash ( "bar/bar.go" ) },
6768 },
6869 },
6970 {
7071 desc : "same suffix with unconstrained expression" ,
7172 patterns : []string {"c/d.go" },
7273 issues : []result.Issue {
73- {RelativePath : "a/b/c/d.go" },
74- {RelativePath : "c/d.go" },
74+ {RelativePath : filepath . FromSlash ( "a/b/c/d.go" ) },
75+ {RelativePath : filepath . FromSlash ( "c/d.go" ) },
7576 },
7677 expected : []result.Issue {},
7778 },
7879 {
7980 desc : "same suffix with constrained expression" ,
8081 patterns : []string {"^c/d.go" },
8182 issues : []result.Issue {
82- {RelativePath : "a/b/c/d.go" },
83- {RelativePath : "c/d.go" },
83+ {RelativePath : filepath . FromSlash ( "a/b/c/d.go" ) },
84+ {RelativePath : filepath . FromSlash ( "c/d.go" ) },
8485 },
8586 expected : []result.Issue {
86- {RelativePath : "a/b/c/d.go" },
87+ {RelativePath : filepath . FromSlash ( "a/b/c/d.go" ) },
8788 },
8889 },
8990 }
0 commit comments