mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
22 lines
379 B
Go
22 lines
379 B
Go
package compiler_test
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestStoragePutGet(t *testing.T) {
|
|
src := `
|
|
package foo
|
|
|
|
import "github.com/nspcc-dev/neo-go/pkg/interop/storage"
|
|
|
|
func Main() string {
|
|
ctx := storage.GetContext()
|
|
key := []byte("token")
|
|
storage.Put(ctx, key, []byte("foo"))
|
|
x := storage.Get(ctx, key)
|
|
return x.(string)
|
|
}
|
|
`
|
|
eval(t, src, []byte("foo"))
|
|
}
|