TestBox 1.0.0 Alpha Need Your Input

Hi ColdBoxers

We need your input. We have released the TestBox alpha yesterday: http://www.coldbox.org/download

Please give us your feedback and suggestions as we push forward for a 1.0 Release and ColdBox 3.8 Release.

Thanks

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Haven’t had a chance to play with it yet, but read through the docs last night. Looks very cool, and can’t wait to try it out!

I just started looking and found an issue with the TestBox component in CF9.

I put an empty component testboxTest.cfc in a folder in testbox called tests and tried to exectue a runner against that component.

Here’s the Runner.cfm: It’s essentially the sample for a single cfc bundle in the documentation.

<cfset runner = new testbox.system.testing.Testbox(“testbox.tests.testboxTest”)>
#runner.run()#



As the runner spins up it eventually calls into BaseSpec.cfc which constructs a suite struct on line 81. Since it creates to no-op lamdbas, it chokes on CF9.

Commenting out the body of the suite struct leads to a successful page load and test run for a bundle of one cfc.

Mathew is this cf9.01 or 9.00

Ok, I figured it out and patched it on the development branch.

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

I’m running through the Prime Factors kata and have gotten an interesting error. Here’s a way to expose the error. 2.0 is not considered equal to 2 when it is an element in an array.

function testFunction() {
var result = myFunction();
$assert.isEqual(result[1], 2); //Passes
$assert.isEqual(result[2], 2); //Passes
$assert.isEqual(result, [2,2]); //Fails ‘Expected [[2, 2]] but received [[2, 2.0]]’
}

function myFunction() {
return [2, 2.0];
}

I am guessing this is on adobe cf?

Yeah 9.01

Ok. Yea. It seems that in cf all variable assignments are set as strings not like in railo where they are numerical.

This seems like a loose evaluation though. As technically 2 is not equal to 2.0 as one is an integer and the other a float?

Suggestions?

At the java level, the comparison between an int and a double would pass because they have comparison semantics that allow it (a delta parameter might be required to account for a certain amount of floating point error but 4.0/2.0 should be a pretty accurate 2.0).

The only thing that I could think was to do an element by element comparision using isEqual on each element. That worked for me locally. I can attach a diff, but you could probably write that length check and for loop faster than I could paste it.

I basically use the java array deep equals function to evaluate equality.

I was trying to avoid iterating over data structures as to avoid nested arrays, structs, objects, closures etc.

Any other suggestions.