forked from AbleScript/ablescript
Add pass-by-reference test (doesn't work yet)
Also rename the "hello_world.able" test to "hello-world.able" for consistency.
This commit is contained in:
parent
e709f398f7
commit
817ca7cf9a
17
able-script-test/pass-by-reference.able
Normal file
17
able-script-test/pass-by-reference.able
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
owo Pass-by-reference test
|
||||||
|
|
||||||
|
owo Swap two variables.
|
||||||
|
functio swap(left, right) {
|
||||||
|
var tmp = left;
|
||||||
|
left = right;
|
||||||
|
right = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
var foo = "hello";
|
||||||
|
var bar = "world";
|
||||||
|
|
||||||
|
swap(foo, bar);
|
||||||
|
|
||||||
|
owo Should print "hello", then "world"
|
||||||
|
bar print;
|
||||||
|
foo print;
|
Loading…
Reference in a new issue