mirror of
https://github.com/bluszcz/cutego.git
synced 2024-09-28 21:25:16 +03:00
20f1341fb4
- Added missing target condition on "internal/cmd/deploy/build.go" - Refactored flag append command on "internal/utils/flags.go" and added tests to verify function behaviour Changes tested on Go 1.14.7 and Qt 5.13.2 and Qt 5.15.0 Signed-off-by: Ángel <angelo.fly1@gmail.com>
22 lines
627 B
Go
22 lines
627 B
Go
package utils
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAppendToFlag(t *testing.T) {
|
|
|
|
flags := []string{"-p", "-pkgdir=/usr/lib/testdir", "-mod", "-modfile go.mod"}
|
|
|
|
flags = AppendToFlag(flags, "-extldflags", "-v")
|
|
require.Equal(t, "-extldflags=-v", flags[4], "Flag was not inserted")
|
|
|
|
flags = AppendToFlag(flags, "-extldflags", "-Wl,soname,libname.so")
|
|
require.Equal(t, "-extldflags=-v -Wl,soname,libname.so", flags[4], "Flag was not appended with new content")
|
|
|
|
flags = AppendToFlag(flags, "-p", "test")
|
|
require.Equal(t, "-p=test", flags[0], "Content was not appended to simple flag")
|
|
}
|