You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it could be very handy if we could also do it in pure as3.
//
Also the AnyOf matcher.
In decompiled Flex :
public function _Test1_AnyOf1_c() : AnyOf
{
var _loc_1:* = new AnyOf();
_loc_1.matchers = [_Test1_EqualTo1_c(), _Test1_CloseTo1_c(), _Test1_Between1_c()];
_loc_1.initialized(this, null);
return _loc_1;
}
The getter "matchers" is really handy if you want add/remove matchers at runtime.
in pure as3 you are forced to do this in one line :
anyOf(equalTo("bad"), equalTo("good"));
not easy if you want create it/update it at runtime.
What do you think ? Good idea ?
Thanks !
The text was updated successfully, but these errors were encountered:
I've been thinking about that issue since I started working on hamcrest-as3. I'll try to get my thoughts down tonight. Its easily the biggest change to make as it affects every matcher, and thats why I haven't actioned anything for it yet.
Hello,
If I compile your MXML example :
<core:AllOf id="numberMatcher" target="{ Number(numberInput.text) }">
<object:NotNull />
core:AnyOf
<object:EqualTo value="17" />
<number:CloseTo value="11" delta="0.3" />
<number:Between min="1" max="9" />
/core:AnyOf
/core:AllOf
If you decompile it, you can see, for the "closeTo" part :
That's nice to see that we can change the properties "value" and "delta" at runtime.
Unfortunatly, we can't do that in pure as3 projects.
The IsCloseToMatcher has no getter/setter for those properties :
http://github.com/drewbourne/hamcrest-as3/blob/master/hamcrest/src/org/hamcrest/number/IsCloseToMatcher.as#L36
I think it could be very handy if we could also do it in pure as3.
//
Also the AnyOf matcher.
In decompiled Flex :
public function _Test1_AnyOf1_c() : AnyOf
{
var _loc_1:* = new AnyOf();
_loc_1.matchers = [_Test1_EqualTo1_c(), _Test1_CloseTo1_c(), _Test1_Between1_c()];
_loc_1.initialized(this, null);
return _loc_1;
}
The getter "matchers" is really handy if you want add/remove matchers at runtime.
in pure as3 you are forced to do this in one line :
anyOf(equalTo("bad"), equalTo("good"));
not easy if you want create it/update it at runtime.
What do you think ? Good idea ?
Thanks !
The text was updated successfully, but these errors were encountered: