-
-
Notifications
You must be signed in to change notification settings - Fork 379
/
Copy pathEffCallFunction.sk
48 lines (36 loc) · 1.87 KB
/
EffCallFunction.sk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function EffCallFunction_global_single_return() :: integer:
return 1
function EffCallFunction_global_multiple_return() :: integers:
return 2 and 3
local function EffCallFunction_local_single_return() :: integer:
return 4
local function EffCallFunction_local_multiple_return() :: integers:
return 5 and 6
test "call functions":
call function "EffCallFunction_global_single_return"
assert last returned values is 1 with "Failed to call global function with single return without arguments"
call function "EffCallFunction_global_multiple_return"
set {_returned::*} to last returned values
if any:
{_returned::1} is not 2
{_returned::2} is not 3
then:
assert false is true with "Failed to call global function with multiple return without arguments"
call function "EffCallFunction_does_not_exist"
assert last returned values are not set with "Returned values are set after calling a non-existent function"
call global function "EffCallFunction_local_single_return"
assert last returned values are not set with "Called local function when global function was specifically requested"
call local function "EffCallFunction_global_single_return" from script "EffCallFunction.sk"
assert last returned values are not set with "Called global function when local function was specifically requested"
call local function "EffCallFunction_local_single_return" from "EffCallFunction.sk"
assert last returned values is 4 with "Failed to call local function with single return without arguments"
call local function "EffCallFunction_local_multiple_return" from "EffCallFunction.sk"
set {_returned::*} to last returned values
if any:
{_returned::1} is not 5
{_returned::2} is not 6
then:
assert false is true with "Failed to call local function with multiple return without arguments"
#test "returned values return type":
# call function "EffCallFunction_global_single_return"
# assert