Skip to content

Commit

Permalink
remove os specific paths
Browse files Browse the repository at this point in the history
  • Loading branch information
armanrahman22 committed Jul 29, 2021
1 parent d88cf5d commit 9525b2b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions pkg/ignore/ignore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ignore

import (
"os"
"runtime"
"path/filepath"
"testing"

"github.com/rs/zerolog"
Expand All @@ -17,15 +17,9 @@ func TestIgnore_Match(t *testing.T) {
i := NewIgnore([]string{"my/files/*"})
assert.NotNil(t, i)

assert.False(t, i.Match("not/foo"))
assert.True(t, i.Match("my/files/file1"))
assert.False(t, i.Match("my/files"))

if runtime.GOOS == "windows" {
assert.False(t, i.Match(`not\foo`))
assert.True(t, i.Match(`my\files\file1`))
assert.False(t, i.Match(`my\files`))
}
assert.False(t, i.Match(filepath.Join("not", "foo")))
assert.True(t, i.Match(filepath.Join("my", "files", "file1")))
assert.False(t, i.Match(filepath.Join("my", "files")))
}

// Test all default ignore files, except for .git/info/exclude, since
Expand Down

0 comments on commit 9525b2b

Please sign in to comment.