From d9fa5605ac98f9ab724199efef8be33680116264 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Thu, 1 Oct 2015 09:39:03 -0600 Subject: [PATCH] Add operator overload tests --- unittests/operator_overload3.chai | 7 +++++++ unittests/operator_overload4.chai | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 unittests/operator_overload3.chai create mode 100644 unittests/operator_overload4.chai diff --git a/unittests/operator_overload3.chai b/unittests/operator_overload3.chai new file mode 100644 index 0000000..90b81cd --- /dev/null +++ b/unittests/operator_overload3.chai @@ -0,0 +1,7 @@ + + +def string::`/=`(double d) { this = "${this}/=${d}"; return this; } + +var s = "Hello World" +s /= 2 + diff --git a/unittests/operator_overload4.chai b/unittests/operator_overload4.chai new file mode 100644 index 0000000..832d984 --- /dev/null +++ b/unittests/operator_overload4.chai @@ -0,0 +1,6 @@ + + +def string::`*`(double d) { return "${this} * ${d}"; } + +"Hello World" * 2 +