mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-09 13:36:56 +02:00
test: added a test case for an invalid main.go
The user could set the main to anything, so, added a test for an invalid file as main.
This commit is contained in:
parent
5a2f6d0318
commit
a9f33bd659
@ -275,6 +275,10 @@ func TestRunPipeWithouMainFunc(t *testing.T) {
|
||||
ctx.Config.Builds[0].Main = ""
|
||||
assert.EqualError(t, Pipe{}.Run(ctx), `build for no-main does not contain a main function`)
|
||||
})
|
||||
t.Run("not main.go", func(t *testing.T) {
|
||||
ctx.Config.Builds[0].Main = "foo.go"
|
||||
assert.EqualError(t, Pipe{}.Run(ctx), `failed dir: foo.go: open foo.go: no such file or directory`)
|
||||
})
|
||||
t.Run("glob", func(t *testing.T) {
|
||||
ctx.Config.Builds[0].Main = "."
|
||||
assert.EqualError(t, Pipe{}.Run(ctx), `build for no-main does not contain a main function`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user