Fixed build package tests on Windows
This commit is contained in:
parent
46102bd44a
commit
5f37a9e84a
1 changed files with 15 additions and 2 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/build"
|
||||
"git.akyoto.dev/cli/q/src/config"
|
||||
"git.akyoto.dev/go/assert"
|
||||
)
|
||||
|
||||
|
@ -22,12 +23,24 @@ func TestBuildFile(t *testing.T) {
|
|||
|
||||
func TestExecutableFromDirectory(t *testing.T) {
|
||||
b := build.New("../../examples/hello")
|
||||
assert.Equal(t, filepath.Base(b.Executable()), "hello")
|
||||
exe := filepath.Base(b.Executable())
|
||||
|
||||
if config.TargetOS != config.Windows {
|
||||
assert.Equal(t, exe, "hello")
|
||||
} else {
|
||||
assert.Equal(t, exe, "hello.exe")
|
||||
}
|
||||
}
|
||||
|
||||
func TestExecutableFromFile(t *testing.T) {
|
||||
b := build.New("../../examples/hello/hello.q")
|
||||
assert.Equal(t, filepath.Base(b.Executable()), "hello")
|
||||
exe := filepath.Base(b.Executable())
|
||||
|
||||
if config.TargetOS != config.Windows {
|
||||
assert.Equal(t, exe, "hello")
|
||||
} else {
|
||||
assert.Equal(t, exe, "hello.exe")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNonExisting(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue