russplaysguitar / UnderscoreCF

An UnderscoreJS port for Coldfusion. Functional programming library.
http://russplaysguitar.github.com/UnderscoreCF/
MIT License
89 stars 38 forks source link

Failing tests on all versions of CF10 (all available updates) #14

Closed atuttle closed 11 years ago

atuttle commented 11 years ago

I initially had trouble as of CF10 update 5, but have since rolled back to every previous update level and confirmed that the issue remains for all of them. I'm starting to think it may be a bug in CF, and if further testing proves that to be true I'll be contacting the CF engineering team.

The issue I'm seeing is that several tests are failing with similar results to:

Expected: [1, 2, 3], Received: [1, 2.0, 3.0]

The following tests are all exhibiting this behavior for me (OSX 10.7.5, Apache 2.2):

I even tried adding a fix() where appropriate, but it had no effect whatsoever.

russplaysguitar commented 11 years ago

it could be a CF bug, considering i've been testing CF 10 on Windows exclusively

atuttle commented 11 years ago

I'm starting to wonder if it could be an issue with MXUnit. I just dropped this into the root of my underscore folder as test.cfm, and everything looks fine, including the _.range(10):

<cfscript>
    _ = new underscore();

    fail = _.range(10);
    writeDump(var=fail, label="_.range(10)");

    customRange = [];
    start = 0;
    step = 1;
    i = 1;
    while (i <= 10){
        customRange[i] = start;
        start += step;
        i++;
    }
    writeDump(var=customRange, label="custom while loop with i++ moved OUT of assignment");

    customRange = [];
    start = 0;
    step = 1;
    for (i = 1; i <= 10; i++){
        customRange[i] = start;
        start += step;
    }
    writeDump(var=customRange, label="for loop");
</cfscript>

All 3 dumps look identical, and seem to be regular integers.

I also added a debug(result) to the corresponding test and see the exact same result. I'm thinking it must be something inside MXUnit that's doing a strange compare.

atuttle commented 11 years ago

Dammit. False alarm. Must have been a bug in MXUnit that's since been fixed. I grabbed the latest version of MXUnit and all tests are passing now. Sorry. :unamused:

russplaysguitar commented 11 years ago

aw, i was kinda looking forward to fixing some bugs too.