github.com/please-build/go-rules/tools/please_go@v0.0.0-20240319165128-ea27d6f5caba/embed/embed_test.go (about) 1 package embed 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func TestParseEmbed(t *testing.T) { 10 cfg, err := Parse([]string{"tools/please_go_embed/embed/test_data/test.go"}) 11 assert.NoError(t, err) 12 assert.Equal(t, map[string][]string{ 13 "hello.txt": {"hello.txt"}, 14 "files/*.txt": {"files/test.txt"}, 15 "files": {"files/test.txt"}, 16 }, cfg.Patterns) 17 assert.Equal(t, map[string]string{ 18 "hello.txt": "tools/please_go_embed/embed/test_data/hello.txt", 19 "files/test.txt": "tools/please_go_embed/embed/test_data/files/test.txt", 20 }, cfg.Files) 21 }