https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112482
Revision: 112482
Author: nikerabbit
Date: 2012-02-27 13:15:03 +0000 (Mon, 27 Feb 2012)
Log Message:
-----------
Consistent whitespace, ping r111995
Modified Paths:
--------------
trunk/extensions/Narayam/tests/qunit/ext.narayam.rules.tests.js
Modified: trunk/extensions/Narayam/tests/qunit/ext.narayam.rules.tests.js
===================================================================
--- trunk/extensions/Narayam/tests/qunit/ext.narayam.rules.tests.js
2012-02-27 13:14:24 UTC (rev 112481)
+++ trunk/extensions/Narayam/tests/qunit/ext.narayam.rules.tests.js
2012-02-27 13:15:03 UTC (rev 112482)
@@ -13,13 +13,15 @@
$.narayam.setup();
$.narayam.enable();
}
+
function teardown() {
// we need to disable narayam, otherwise many typing simulation based
test eg: jquery.byteLimitTest will fail.
$.narayam.disable();
}
+
test( "-- Initial check", function() {
expect( 1 );
- ok( $.narayam, "$.narayam is defined" );
+ ok( $.narayam, '$.narayam is defined' );
} );
// Basic sendkey-implementation
@@ -43,82 +45,79 @@
$input: null,
tests: [],
scheme: '' // The input method name.
- }, options);
+ }, options );
test( opt.description, function() {
- expect( opt.tests.length);
- $.narayam.enable( );
+ expect( opt.tests.length );
+ $.narayam.enable();
stop();
- $.narayam.setScheme( opt.scheme, function(){
+ $.narayam.setScheme( opt.scheme, function () {
opt.$input.appendTo( '#qunit-fixture' );
- $.narayam.addInputs (opt.$input);
+ $.narayam.addInputs( opt.$input );
$.narayam.setScheme( opt.scheme );
for ( var i= 0 ; i < opt.tests.length; i++ ) {
// Simulate pressing keys for each of the
sample characters
typeChars( opt.$input, opt.tests[i].input );
- equals( opt.$input.val(), opt.tests[i].output,
opt.tests[i].description );
- opt.$input.val('');
+ equals( opt.$input.val(), opt.tests[i].output,
opt.tests[i].description );
+ opt.$input.val( '' );
}
$.narayam.disable();
start();
- });
+ } );
} );
};
-narayamTest ( {
+narayamTest( {
description: 'Malayalam Transliteration test',
tests: [
- { input : 'ra', output : 'ര', description : 'Malayalam ra'},
- { input : 'nta', output : 'ന്റ', description : 'Malayalam nta'}
+ { input: 'ra', output: 'ര', description: 'Malayalam ra' },
+ { input: 'nta', output: 'ന്റ', description: 'Malayalam nta' }
],
- scheme : 'ml',
- $input: $( '<input >' ).attr( { 'id':"ml", 'type' :'text' } )
+ scheme: 'ml',
+ $input: $( '<input>' ).attr( { id: 'ml', type: 'text' } )
} );
-narayamTest ( {
+narayamTest( {
description: 'Oriya Inscript test',
- tests : [
- { input : 'ka', output : 'କୋ' }
- ],
- scheme : 'or-inscript',
- $input: $( '<input >' ).attr( { 'id':"or", 'type' :'text' } )
+ tests: [{ input: 'ka', output: 'କୋ' }],
+ scheme: 'or-inscript',
+ $input: $( '<input>' ).attr( { id: 'or', type: 'text' } )
} );
-narayamTest ( {
+narayamTest( {
description: 'Malayalam Inscript test',
- tests : [
- { input : 'ka', output : 'കോ' }
- ],
- scheme : 'ml-inscript',
- $input: $( '<input >' ).attr( { 'id':"ml-inscript", 'type' :'text' } )
+ tests: [{ input: 'ka', output: 'കോ' }],
+ scheme: 'ml-inscript',
+ $input: $( '<input>' ).attr( { id: 'ml-inscript', type: 'text' } )
} );
-narayamTest ( {
+narayamTest( {
description: 'Tamil Inscript test',
- tests : [
- { input : 'ka', output : 'கோ', description : 'Tamil Inscript
கோ' }
+ tests: [
+ { input: 'ka', output: 'கோ', description: 'Tamil Inscript கோ' }
],
- scheme : 'ta-inscript',
- $input: $( '<input >' ).attr( { 'id':"ta-inscript", 'type' :'text' } )
+ scheme: 'ta-inscript',
+ $input: $( '<input>' ).attr( { id: 'ta-inscript', type: 'text' } )
} );
narayamTest ( {
description: 'Amharic Transliteration test',
- tests : [
- { input : 'ka', output : 'ካ', description : 'Amharic ka->ካ' }
+ tests: [
+ { input: 'ka', output: 'ካ', description: 'Amharic ka->ካ' }
],
- scheme : 'am',
- $input: $( '<input >' ).attr( { 'id':"am", 'type' :'text' } )
+ scheme: 'am',
+ $input: $( '<input>' ).attr( { id: 'am', type: 'text' } )
} );
narayamTest ( {
description: 'Marathi Transliteration test',
- tests : [
- { input : 'dny', output : 'ज्ञ्', description : 'dny for ज्ञ्
in Marathi transliteration' }
+ tests: [
+ { input: 'dny', output: 'ज्ञ्', description: 'dny for ज्ञ् in
Marathi transliteration' }
],
- scheme : 'mr',
- $input: $( '<input >' ).attr( { 'id':"mr", 'type' :'text' } )
+ scheme: 'mr',
+ $input: $( '<input>' ).attr( { id: "mr", type: 'text' } )
} );
teardown( );
-} ( ) );
+
+}() );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs