[#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()
|
'Methods support visibility escalation or equality': function()
|
||||||
{
|
{
|
||||||
var tests = [
|
var _self = this;
|
||||||
[ 'private', 'protected' ],
|
shared.visEscalationTest( function( cur )
|
||||||
[ 'protected', 'public' ],
|
|
||||||
|
|
||||||
[ 'public', 'public' ],
|
|
||||||
[ 'protected', 'protected' ],
|
|
||||||
[ 'private', 'private' ]
|
|
||||||
];
|
|
||||||
|
|
||||||
for ( var i = 0, len = tests.length; i < len; i++ )
|
|
||||||
{
|
{
|
||||||
var cur = tests[ i ];
|
_self.quickVisChangeTest( cur[ 0 ], cur[ 1 ], false );
|
||||||
this.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