tideliftcli/main_test.go

32 lines
713 B
Go
Raw Normal View History

2019-05-14 03:26:13 +00:00
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")
}