actionscript 3 - AS3 Hamcrest - Assert one array contains all of another -
i attempting use hamcrest matchers come flashbuilder 4.7 environment. have 2 arrays, array , array b. want make sure of members of b found in regardless of order. i'm looking works kind of this.
var a:array = new array( 1, 2, 3, 4); var b:array = new array( 1, 2, 3, 4 ); //both arrays contain same values should //return true assertthat( , haseachandeverylastoneinsideofit(b));
right i've tried 'allof' , 'hasitems' i'm not quite able grip on syntax.
here's gist handle custom hamcrest matcher.
usage : assertthat( , arrayexact(b) );
the matcher class :
https://gist.github.com/jamieowen/5480802
and shorthand "arrayexact()" function access:
https://gist.github.com/jamieowen/5480819
it should match 2d arrays well.
Comments
Post a Comment