mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-20 14:26:42 +00:00
test multiline
This commit is contained in:
@ -5,9 +5,15 @@ import "func.aqua"
|
||||
|
||||
service TestS("some-id"):
|
||||
t: string -> string
|
||||
multiline(a: string,
|
||||
b: string,
|
||||
c: bool) -> string
|
||||
|
||||
-- just a lot of imports and calls
|
||||
func doStuff(a: string, b: string, c: bool, d: bool, e: []string, g: []string, str: string) -> []string:
|
||||
func doStuff(a: string,
|
||||
b: string,
|
||||
c: bool,
|
||||
d: bool, e: []string, g: []string, str: string) -> []string:
|
||||
stream: *string
|
||||
stream <- TestS.t(str)
|
||||
par Println.print(a)
|
||||
@ -22,4 +28,7 @@ func doStuff(a: string, b: string, c: bool, d: bool, e: []string, g: []string, s
|
||||
stream <- TestS.t(gEl)
|
||||
stream <- TestS.t(eEl)
|
||||
stream <- TestS.t(eEl)
|
||||
stream <- TestS.multiline(a,
|
||||
b,
|
||||
c)
|
||||
<- stream
|
||||
|
@ -8,6 +8,7 @@ service OpO("op"):
|
||||
|
||||
-- a question mark means that this constant could be rewritten before this definition
|
||||
const anotherConst ?= "default-str"
|
||||
const uniqueConst ?= 5
|
||||
|
||||
func callConstant() -> []string:
|
||||
res: *string
|
||||
|
@ -32,6 +32,7 @@ export async function doStuff(client: FluenceClient, a: string, b: string, c: bo
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
@ -110,17 +111,16 @@ export async function doStuff(client: FluenceClient, a: string, b: string, c: bo
|
||||
)
|
||||
(null)
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call %init_peer_id% ("some-id" "multiline") [a b c] $stream)
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [$stream])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4])
|
||||
|
@ -8,5 +8,9 @@ export async function complexCall(client: FluenceClient) {
|
||||
return args[0]
|
||||
})
|
||||
|
||||
registerServiceFunction(client, "some-id", "multiline", (args: any[], _) => {
|
||||
return args[1]
|
||||
})
|
||||
|
||||
return await doStuff(client, client.relayPeerId!, client.selfPeerId, true, true, ["1", "2"], ["3", "4"], "some str")
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ const main = async () => {
|
||||
|
||||
checkCall("dataAliasCall", dataAliasResult, "peer id str", cb)
|
||||
|
||||
checkCall("complexCall", complexCallResult, ["some str", "3", "1", "4", "1", "1", "3", "2", "4", "2", "2"], cb)
|
||||
checkCall("complexCall", complexCallResult, ["some str", "3", "1", "4", "1", "1", "3", "2", "4", "2", "2", client.selfPeerId], cb)
|
||||
|
||||
checkCall("constantCall", constantCallResult, ['1', 'ab'], cb)
|
||||
|
||||
|
Reference in New Issue
Block a user