26 lines
487 B
Go
26 lines
487 B
Go
package build_test
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"git.akyoto.dev/cli/q/src/build"
|
|
"git.akyoto.dev/go/assert"
|
|
)
|
|
|
|
func TestBuild(t *testing.T) {
|
|
b := build.New("../../examples/hello")
|
|
_, err := b.Run()
|
|
assert.Nil(t, err)
|
|
}
|
|
|
|
func TestExecutable(t *testing.T) {
|
|
b := build.New("../../examples/hello")
|
|
assert.Equal(t, filepath.Base(b.Executable()), "hello")
|
|
}
|
|
|
|
func TestNonExisting(t *testing.T) {
|
|
b := build.New("does-not-exist")
|
|
_, err := b.Run()
|
|
assert.NotNil(t, err)
|
|
}
|