tideliftcli/main_test.go
2019-05-15 22:41:11 -04:00

32 lines
713 B
Go

package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetManifestGlobMatches(t *testing.T) {
//assert getManifestMatches gets all requirements.txt
expected := []string{
"test/fixtures/subdir/requirements.txt",
"test/fixtures/a/b/c/d/e/f/g/requirements.txt",
}
got := getManifestGlobMatches("test/**/requirements.txt")
assert.Equal(t, expected, got, "they should be equal")
}
func TestGetAllManifests(t *testing.T) {
all := []string{
"test/fixtures/yarn.lock",
"test/fixtures/Gemfile",
"test/fixtures/subdir/requirements.txt",
"test/fixtures/a/b/c/d/e/f/g/requirements.txt",
}
got := getAllManifests("test/")
assert.Equal(t, all, got, "they should match")
}