Add operator overload tests
This commit is contained in:
7
unittests/operator_overload3.chai
Normal file
7
unittests/operator_overload3.chai
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
def string::`/=`(double d) { this = "${this}/=${d}"; return this; }
|
||||||
|
|
||||||
|
var s = "Hello World"
|
||||||
|
s /= 2
|
||||||
|
|
6
unittests/operator_overload4.chai
Normal file
6
unittests/operator_overload4.chai
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
def string::`*`(double d) { return "${this} * ${d}"; }
|
||||||
|
|
||||||
|
"Hello World" * 2
|
||||||
|
|
Reference in New Issue
Block a user