neoneo-go/pkg/vm/tests/import_test.go
Anthony De Meulemeester 35551282b0
Porting the NEX ICO template to neo-go as first class smart contract example (#78)
* Initial draft of the ICO template ported from NEX.

* filled in token configuration

* added kyc storage prefix

* fixed byte array conversion + added tests

* fixed broken test + made 1 file for the token sale example.

* implemented the NEP5 handlers

* bumped version
2018-05-06 08:03:26 +02:00

50 lines
768 B
Go

package vm_test
import (
"math/big"
"testing"
)
func TestImportFunction(t *testing.T) {
src := `
package somethingelse
import "github.com/CityOfZion/neo-go/pkg/vm/tests/foo"
func Main() int {
i := foo.NewBar()
return i
}
`
eval(t, src, big.NewInt(10))
}
func TestImportStruct(t *testing.T) {
src := `
package somethingwedontcareabout
import "github.com/CityOfZion/neo-go/pkg/vm/tests/bar"
func Main() int {
b := bar.Bar{
X: 4,
}
return b.Y
}
`
eval(t, src, big.NewInt(0))
}
func TestMultipleDirFileImport(t *testing.T) {
src := `
package hello
import "github.com/CityOfZion/neo-go/pkg/vm/tests/foobar"
func Main() bool {
ok := foobar.OtherBool()
return ok
}
`
eval(t, src, big.NewInt(1))
}