From 316565a1684872682b23d86b5c4bf98b5de225ea Mon Sep 17 00:00:00 2001 From: Dima Granetchi Date: Wed, 26 Nov 2014 14:24:29 +0200 Subject: [PATCH] expr bind old value test --- test/ChainBindTest.hx | 1 - test/ExprBindTest.hx | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/ChainBindTest.hx b/test/ChainBindTest.hx index 4cd5fe7..2917f08 100644 --- a/test/ChainBindTest.hx +++ b/test/ChainBindTest.hx @@ -7,7 +7,6 @@ import buddy.BuddySuite; using buddy.Should; -//@exclude class ChainBindTest extends BuddySuite { public function new() { diff --git a/test/ExprBindTest.hx b/test/ExprBindTest.hx index 287147f..9469d5a 100644 --- a/test/ExprBindTest.hx +++ b/test/ExprBindTest.hx @@ -7,7 +7,6 @@ import buddy.BuddySuite; using buddy.Should; -//@exclude class ExprBindTest extends BuddySuite { public function new() { @@ -15,7 +14,9 @@ class ExprBindTest extends BuddySuite { describe("Using BindExt.expr", { var callNum:Int; + var from:String; before({ + from = null; callNum = 0; }); @@ -26,7 +27,9 @@ class ExprBindTest extends BuddySuite { b.str = "b1"; inline function val() return b.str + "ab".charAt(a.str.length - 2) + Std.string(1); - BindExt.expr(b.str + "ab".charAt(a.str.length - 2) + Std.string(1), function (from, to:String) { + BindExt.expr(b.str + "ab".charAt(a.str.length - 2) + Std.string(1), function (f, to:String) { + f.should.be(from); + from = to; to.should.be(val()); callNum ++; }); @@ -50,8 +53,11 @@ class ExprBindTest extends BuddySuite { b.str = ""; c.str = "1"; inline function val() return if (a.str.charAt(b.str.length) == Std.string(c.str)) 1 else 0; + var from:Null = null; - BindExt.expr(if (a.str.charAt(b.str.length) == Std.string(c.str)) 1 else 0, function (from, to:Null) { + BindExt.expr(if (a.str.charAt(b.str.length) == Std.string(c.str)) 1 else 0, function (f, to:Null) { + f.should.be(from); + from = to; to.should.be(val()); callNum ++; });