From 29e858df660c9be41290a0127df08154fac4d0a0 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 5 Oct 2022 18:06:06 +0300 Subject: [PATCH] cli: move nep11/nep17 tests into a package of their own The tests are still there, coverage should counted fine, but it improves things: ? github.com/nspcc-dev/neo-go/cli [no test files] ok github.com/nspcc-dev/neo-go/cli/app 0.058s coverage: 100.0% of statements ok github.com/nspcc-dev/neo-go/cli/cmdargs 0.005s coverage: 60.8% of statements ok github.com/nspcc-dev/neo-go/cli/flags 0.027s coverage: 97.7% of statements ? github.com/nspcc-dev/neo-go/cli/input [no test files] ok github.com/nspcc-dev/neo-go/cli/nep_test 30.443s coverage: [no statements] ok github.com/nspcc-dev/neo-go/cli/options 0.054s coverage: 50.0% of statements ? github.com/nspcc-dev/neo-go/cli/paramcontext [no test files] ok github.com/nspcc-dev/neo-go/cli/query 2.089s coverage: 45.3% of statements ok github.com/nspcc-dev/neo-go/cli/server 1.510s coverage: 67.8% of statements ok github.com/nspcc-dev/neo-go/cli/smartcontract 8.433s coverage: 94.3% of statements ok github.com/nspcc-dev/neo-go/cli/util 0.013s coverage: 10.9% of statements ? github.com/nspcc-dev/neo-go/cli/vm [no test files] ok github.com/nspcc-dev/neo-go/cli/wallet 47.252s coverage: 63.0% of statements --- cli/{wallet => nep_test}/nep11_test.go | 6 +++++- cli/{wallet => nep_test}/nep17_test.go | 2 +- cli/wallet/wallet_test.go | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) rename cli/{wallet => nep_test}/nep11_test.go (98%) rename cli/{wallet => nep_test}/nep17_test.go (99%) diff --git a/cli/wallet/nep11_test.go b/cli/nep_test/nep11_test.go similarity index 98% rename from cli/wallet/nep11_test.go rename to cli/nep_test/nep11_test.go index 13ae26b76..adcc22e29 100644 --- a/cli/wallet/nep11_test.go +++ b/cli/nep_test/nep11_test.go @@ -1,4 +1,4 @@ -package wallet_test +package nep_test import ( "bytes" @@ -659,3 +659,7 @@ func deployNFTContract(t *testing.T, e *testcli.Executor) util.Uint160 { func deployNNSContract(t *testing.T, e *testcli.Executor) util.Uint160 { return testcli.DeployContract(t, e, "../../examples/nft-nd-nns/", "../../examples/nft-nd-nns/nns.yml", testcli.ValidatorWallet, testcli.ValidatorAddr, testcli.ValidatorPass) } + +func deployVerifyContract(t *testing.T, e *testcli.Executor) util.Uint160 { + return testcli.DeployContract(t, e, "../smartcontract/testdata/verify.go", "../smartcontract/testdata/verify.yml", testcli.ValidatorWallet, testcli.ValidatorAddr, testcli.ValidatorPass) +} diff --git a/cli/wallet/nep17_test.go b/cli/nep_test/nep17_test.go similarity index 99% rename from cli/wallet/nep17_test.go rename to cli/nep_test/nep17_test.go index c451f0241..081780928 100644 --- a/cli/wallet/nep17_test.go +++ b/cli/nep_test/nep17_test.go @@ -1,4 +1,4 @@ -package wallet_test +package nep_test import ( "io" diff --git a/cli/wallet/wallet_test.go b/cli/wallet/wallet_test.go index fb7229355..db1601b5c 100644 --- a/cli/wallet/wallet_test.go +++ b/cli/wallet/wallet_test.go @@ -904,3 +904,7 @@ func TestWalletConvert(t *testing.T) { require.Equal(t, exp, act) } } + +func deployNNSContract(t *testing.T, e *testcli.Executor) util.Uint160 { + return testcli.DeployContract(t, e, "../../examples/nft-nd-nns/", "../../examples/nft-nd-nns/nns.yml", testcli.ValidatorWallet, testcli.ValidatorAddr, testcli.ValidatorPass) +}