ChaiScript/unittests/operator_overload.chai
2011-09-24 12:05:08 -06:00

10 lines
132 B
ChaiScript

def Bob::`+`(y) { this.x + y.x }
def Bob::Bob() { }
attr Bob::x
auto b = Bob()
auto c = Bob()
b.x = 4
c.x = 5
assert_equal(9, b+c)