Add operator overload tests
This commit is contained in:
parent
3a8cb581cc
commit
d9fa5605ac
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user