massive-oss / MassiveUnit

munit is a cross-platform unit testing framework for Haxe. Utilises metadata markup for test cases and includes tools for generating, compiling and running test cases from the command line.
Other
180 stars 56 forks source link

Assert.areSame() doesn't work with basic types anymore in 2.2.1 #150

Open Gama11 opened 6 years ago

Gama11 commented 6 years ago

Flixel's CI broke with the 2.2.1 release of MUnit. It seems areSame() no longer supports basic types such as Int, Float or Bool:

class AreSameTest {
    function test() {
        massive.munit.Assert.areSame(0, 0);
    }
}

Constraint check failure for areSame.T Int should be massive.munit._Assert.RefType Int should be haxe.extern.EitherType<{ }, haxe.Function>

This makes sense when looking at RefType, which requires the parameters to be either a structure or a function. RefType was added in #144 by @SlavaRa. This behavior is probably expected and these calls can easily just be replaced with areEqual(). However, this should probably be clarified in the method's docs? The description of the two methods is almost identical:

Assert that two values are not equal

vs

Assert that two values are one and the same

with no mention of what "values" means exactly (more specifically that not all values are allowed for areSame()).