[#25] Moved bulk of visibility escalation test into common file to be shared with other member tests
parent
93021f3dbc
commit
31a7980e37
|
@ -287,20 +287,11 @@ require( 'common' ).testCase(
|
|||
*/
|
||||
'Methods support visibility escalation or equality': function()
|
||||
{
|
||||
var tests = [
|
||||
[ 'private', 'protected' ],
|
||||
[ 'protected', 'public' ],
|
||||
|
||||
[ 'public', 'public' ],
|
||||
[ 'protected', 'protected' ],
|
||||
[ 'private', 'private' ]
|
||||
];
|
||||
|
||||
for ( var i = 0, len = tests.length; i < len; i++ )
|
||||
var _self = this;
|
||||
shared.visEscalationTest( function( cur )
|
||||
{
|
||||
var cur = tests[ i ];
|
||||
this.quickVisChangeTest( cur[ 0 ], cur[ 1 ], false );
|
||||
}
|
||||
_self.quickVisChangeTest( cur[ 0 ], cur[ 1 ], false );
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
|
|
|
@ -120,3 +120,30 @@ exports.quickKeywordTest = function( type, keywords, identifier, prev )
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Passes test visibility levels [ x1, x2 ] to test method T to ensure that test
|
||||
* T will pass when x2 is used to override a member declared using x1
|
||||
*
|
||||
* @param {function(function())} test test function
|
||||
*
|
||||
* @return {undefined}
|
||||
*/
|
||||
exports.visEscalationTest = function( test )
|
||||
{
|
||||
var tests = [
|
||||
[ 'private', 'protected' ],
|
||||
[ 'protected', 'public' ],
|
||||
|
||||
[ 'public', 'public' ],
|
||||
[ 'protected', 'protected' ],
|
||||
[ 'private', 'private' ]
|
||||
];
|
||||
|
||||
for ( var i = 0, len = tests.length; i < len; i++ )
|
||||
{
|
||||
var cur = tests[ i ];
|
||||
test( cur );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue