From 817ca7cf9ae9a4995826436d758e7067e3312b0b Mon Sep 17 00:00:00 2001 From: Alex Bethel Date: Sun, 13 Jun 2021 09:50:18 -0500 Subject: [PATCH] Add pass-by-reference test (doesn't work yet) Also rename the "hello_world.able" test to "hello-world.able" for consistency. --- .../{hello_world.able => hello-world.able} | 0 able-script-test/pass-by-reference.able | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) rename able-script-test/{hello_world.able => hello-world.able} (100%) create mode 100644 able-script-test/pass-by-reference.able diff --git a/able-script-test/hello_world.able b/able-script-test/hello-world.able similarity index 100% rename from able-script-test/hello_world.able rename to able-script-test/hello-world.able diff --git a/able-script-test/pass-by-reference.able b/able-script-test/pass-by-reference.able new file mode 100644 index 00000000..27871048 --- /dev/null +++ b/able-script-test/pass-by-reference.able @@ -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;