mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-03-15 19:51:13 +00:00
make imports-exports tests more complex
This commit is contained in:
parent
462635fa71
commit
e3cc2bc230
@ -1,5 +1,7 @@
|
|||||||
module Export declares foobar, foo
|
module Export declares foobar, foo
|
||||||
|
|
||||||
|
import Op as Noop from "@fluencelabs/aqua-lib/builtin.aqua"
|
||||||
|
|
||||||
func bar() -> string:
|
func bar() -> string:
|
||||||
<- " I am MyFooBar bar"
|
<- " I am MyFooBar bar"
|
||||||
|
|
||||||
@ -7,6 +9,7 @@ func foo() -> string:
|
|||||||
<- "I am MyFooBar foo"
|
<- "I am MyFooBar foo"
|
||||||
|
|
||||||
func foobar() -> []string:
|
func foobar() -> []string:
|
||||||
|
Noop.noop()
|
||||||
res: *string
|
res: *string
|
||||||
res <- foo()
|
res <- foo()
|
||||||
res <- bar()
|
res <- bar()
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
-- exports3.aqua
|
-- exports3.aqua
|
||||||
module Export3 declares *
|
module Export3 declares *
|
||||||
|
|
||||||
|
import Op as Noop from "@fluencelabs/aqua-lib/builtin.aqua"
|
||||||
|
|
||||||
func foo() -> string:
|
func foo() -> string:
|
||||||
|
Noop.noop()
|
||||||
<- "I am MyFooBar foo"
|
<- "I am MyFooBar foo"
|
@ -1,5 +1,7 @@
|
|||||||
module Exports declares some_string, MyExportSrv, EXPORT_CONST, some_random_func
|
module Exports declares some_string, MyExportSrv, EXPORT_CONST, some_random_func
|
||||||
|
|
||||||
|
import Op as Noop from "@fluencelabs/aqua-lib/builtin.aqua"
|
||||||
|
|
||||||
export some_string as string_from_lib
|
export some_string as string_from_lib
|
||||||
export MyExportSrv
|
export MyExportSrv
|
||||||
|
|
||||||
@ -9,6 +11,7 @@ service MyExportSrv("my_export_srv"):
|
|||||||
another_str() -> string
|
another_str() -> string
|
||||||
|
|
||||||
func some_string() -> string:
|
func some_string() -> string:
|
||||||
|
Noop.noop()
|
||||||
<- "some_string_func"
|
<- "some_string_func"
|
||||||
|
|
||||||
func some_random_func() -> string:
|
func some_random_func() -> string:
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
-- imports3.aqua
|
-- imports3.aqua
|
||||||
module Import3 declares *
|
module Import3 declares *
|
||||||
|
import Op as Noop from "@fluencelabs/aqua-lib/builtin.aqua"
|
||||||
|
|
||||||
export foo_wrapper
|
export foo_wrapper
|
||||||
|
|
||||||
use "export3.aqua"
|
use "export3.aqua"
|
||||||
|
|
||||||
func foo_wrapper() -> string:
|
func foo_wrapper() -> string:
|
||||||
|
Noop.noop()
|
||||||
z <- Export3.foo()
|
z <- Export3.foo()
|
||||||
<- z
|
<- z
|
@ -2,17 +2,22 @@ import decl_foo, decl_bar from "declare.aqua"
|
|||||||
use DECLARE_CONST, SuperFoo, DECLARE_CONST2 as DC2 from "declare.aqua" as Declare
|
use DECLARE_CONST, SuperFoo, DECLARE_CONST2 as DC2 from "declare.aqua" as Declare
|
||||||
import Op as Noop from "@fluencelabs/aqua-lib/builtin.aqua"
|
import Op as Noop from "@fluencelabs/aqua-lib/builtin.aqua"
|
||||||
import some_string, MyExportSrv, EXPORT_CONST from "exports.aqua"
|
import some_string, MyExportSrv, EXPORT_CONST from "exports.aqua"
|
||||||
|
use "export3.aqua"
|
||||||
|
|
||||||
service StringService("string_service"):
|
service StringService("string_service"):
|
||||||
concat(a: string, b: string) -> string
|
concat(a: string, b: string) -> string
|
||||||
|
|
||||||
func concat_foobars() -> string:
|
func concat_foobars() -> string:
|
||||||
|
Noop.noop()
|
||||||
|
Export3.foo()
|
||||||
res1 <- decl_foo()
|
res1 <- decl_foo()
|
||||||
res2 <- decl_bar()
|
res2 <- decl_bar()
|
||||||
res3 <- StringService.concat(res1, res2)
|
res3 <- StringService.concat(res1, res2)
|
||||||
res4 <- Declare.SuperFoo.small_foo()
|
res4 <- Declare.SuperFoo.small_foo()
|
||||||
|
Noop.noop()
|
||||||
res5 <- StringService.concat(res3, res4)
|
res5 <- StringService.concat(res3, res4)
|
||||||
res6 <- StringService.concat(res5, EXPORT_CONST)
|
res6 <- StringService.concat(res5, EXPORT_CONST)
|
||||||
res7 <- StringService.concat(res6, Declare.DECLARE_CONST)
|
res7 <- StringService.concat(res6, Declare.DECLARE_CONST)
|
||||||
|
Noop.noop()
|
||||||
res8 <- StringService.concat(res7, Declare.DC2)
|
res8 <- StringService.concat(res7, Declare.DC2)
|
||||||
<- res8
|
<- res8
|
Loading…
x
Reference in New Issue
Block a user