mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-13 15:45:01 +00:00
eeb439f548
Network server constructor reads config.Version variable, and testcli.DeployContract writes dummy config.Version which causes race in tests. Avoid this race by moving config.Version initialisation to a separate package and perform it inside test packages init(). Close #3011, close #3017. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
19 lines
509 B
Go
19 lines
509 B
Go
package app_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neo-go/internal/testcli"
|
|
"github.com/nspcc-dev/neo-go/internal/versionutil"
|
|
"github.com/nspcc-dev/neo-go/pkg/config"
|
|
)
|
|
|
|
func TestCLIVersion(t *testing.T) {
|
|
config.Version = versionutil.TestVersion // Zero-length version string disables '--version' completely.
|
|
e := testcli.NewExecutor(t, false)
|
|
e.Run(t, "neo-go", "--version")
|
|
e.CheckNextLine(t, "^NeoGo")
|
|
e.CheckNextLine(t, "^Version:")
|
|
e.CheckNextLine(t, "^GoVersion:")
|
|
e.CheckEOF(t)
|
|
}
|