package main import ( "sort" "testing" "github.com/stretchr/testify/assert" ) func TestGetListOfGlobMatches(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 := getListOfGlobMatches("test/**/requirements.txt") sort.Strings(expected) sort.Strings(got) assert.Equal(t, expected, got, "they should be equal") } func TestGetListOfManifestFilenames(t *testing.T) { expected := []string{ "test/fixtures/yarn.lock", "test/fixtures/Gemfile", "test/fixtures/a/b/c/d/e/f/g/requirements.txt", "test/fixtures/subdir/requirements.txt", } got := getListOfManifestFilenames("test/") sort.Strings(expected) sort.Strings(got) assert.Equal(t, expected, got, "they should match") }