From d59b75fdb390e7d17ee51418210ac13ac89ee7d8 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 0000000..2787104 --- /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;