r112482 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112481‎ | r112482 | r112483 >
Date:13:15, 27 February 2012
Author:nikerabbit
Status:ok
Tags:
Comment:
Consistent whitespace, ping r111995
Modified paths:
  • /trunk/extensions/Narayam/tests/qunit/ext.narayam.rules.tests.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/tests/qunit/ext.narayam.rules.tests.js
@@ -13,13 +13,15 @@
1414 $.narayam.setup();
1515 $.narayam.enable();
1616 }
 17+
1718 function teardown() {
1819 // we need to disable narayam, otherwise many typing simulation based test eg: jquery.byteLimitTest will fail.
1920 $.narayam.disable();
2021 }
 22+
2123 test( "-- Initial check", function() {
2224 expect( 1 );
23 - ok( $.narayam, "$.narayam is defined" );
 25+ ok( $.narayam, '$.narayam is defined' );
2426 } );
2527
2628 // Basic sendkey-implementation
@@ -43,82 +45,79 @@
4446 $input: null,
4547 tests: [],
4648 scheme: '' // The input method name.
47 - }, options);
 49+ }, options );
4850
4951 test( opt.description, function() {
50 - expect( opt.tests.length);
51 - $.narayam.enable( );
 52+ expect( opt.tests.length );
 53+ $.narayam.enable();
5254 stop();
53 - $.narayam.setScheme( opt.scheme, function(){
 55+ $.narayam.setScheme( opt.scheme, function () {
5456 opt.$input.appendTo( '#qunit-fixture' );
55 - $.narayam.addInputs (opt.$input);
 57+ $.narayam.addInputs( opt.$input );
5658 $.narayam.setScheme( opt.scheme );
5759 for ( var i= 0 ; i < opt.tests.length; i++ ) {
5860 // Simulate pressing keys for each of the sample characters
5961 typeChars( opt.$input, opt.tests[i].input );
60 - equals( opt.$input.val(), opt.tests[i].output, opt.tests[i].description );
61 - opt.$input.val('');
 62+ equals( opt.$input.val(), opt.tests[i].output, opt.tests[i].description );
 63+ opt.$input.val( '' );
6264 }
6365 $.narayam.disable();
6466 start();
65 - });
 67+ } );
6668 } );
6769 };
6870
69 -narayamTest ( {
 71+narayamTest( {
7072 description: 'Malayalam Transliteration test',
7173 tests: [
72 - { input : 'ra', output : 'ര', description : 'Malayalam ra'},
73 - { input : 'nta', output : 'ന്റ', description : 'Malayalam nta'}
 74+ { input: 'ra', output: 'ര', description: 'Malayalam ra' },
 75+ { input: 'nta', output: 'ന്റ', description: 'Malayalam nta' }
7476 ],
75 - scheme : 'ml',
76 - $input: $( '<input >' ).attr( { 'id':"ml", 'type' :'text' } )
 77+ scheme: 'ml',
 78+ $input: $( '<input>' ).attr( { id: 'ml', type: 'text' } )
7779 } );
7880
79 -narayamTest ( {
 81+narayamTest( {
8082 description: 'Oriya Inscript test',
81 - tests : [
82 - { input : 'ka', output : 'କୋ' }
83 - ],
84 - scheme : 'or-inscript',
85 - $input: $( '<input >' ).attr( { 'id':"or", 'type' :'text' } )
 83+ tests: [{ input: 'ka', output: 'କୋ' }],
 84+ scheme: 'or-inscript',
 85+ $input: $( '<input>' ).attr( { id: 'or', type: 'text' } )
8686 } );
8787
88 -narayamTest ( {
 88+narayamTest( {
8989 description: 'Malayalam Inscript test',
90 - tests : [
91 - { input : 'ka', output : 'കോ' }
92 - ],
93 - scheme : 'ml-inscript',
94 - $input: $( '<input >' ).attr( { 'id':"ml-inscript", 'type' :'text' } )
 90+ tests: [{ input: 'ka', output: 'കോ' }],
 91+ scheme: 'ml-inscript',
 92+ $input: $( '<input>' ).attr( { id: 'ml-inscript', type: 'text' } )
9593 } );
9694
97 -narayamTest ( {
 95+narayamTest( {
9896 description: 'Tamil Inscript test',
99 - tests : [
100 - { input : 'ka', output : 'கோ', description : 'Tamil Inscript கோ' }
 97+ tests: [
 98+ { input: 'ka', output: 'கோ', description: 'Tamil Inscript கோ' }
10199 ],
102 - scheme : 'ta-inscript',
103 - $input: $( '<input >' ).attr( { 'id':"ta-inscript", 'type' :'text' } )
 100+ scheme: 'ta-inscript',
 101+ $input: $( '<input>' ).attr( { id: 'ta-inscript', type: 'text' } )
104102 } );
105103
106104 narayamTest ( {
107105 description: 'Amharic Transliteration test',
108 - tests : [
109 - { input : 'ka', output : 'ካ', description : 'Amharic ka->ካ' }
 106+ tests: [
 107+ { input: 'ka', output: 'ካ', description: 'Amharic ka->ካ' }
110108 ],
111 - scheme : 'am',
112 - $input: $( '<input >' ).attr( { 'id':"am", 'type' :'text' } )
 109+ scheme: 'am',
 110+ $input: $( '<input>' ).attr( { id: 'am', type: 'text' } )
113111 } );
114112
115113 narayamTest ( {
116114 description: 'Marathi Transliteration test',
117 - tests : [
118 - { input : 'dny', output : 'ज्ञ्', description : 'dny for ज्ञ् in Marathi transliteration' }
 115+ tests: [
 116+ { input: 'dny', output: 'ज्ञ्', description: 'dny for ज्ञ् in Marathi transliteration' }
119117 ],
120 - scheme : 'mr',
121 - $input: $( '<input >' ).attr( { 'id':"mr", 'type' :'text' } )
 118+ scheme: 'mr',
 119+ $input: $( '<input>' ).attr( { id: "mr", type: 'text' } )
122120 } );
123121
124122 teardown( );
125 -} ( ) );
 123+
 124+}() );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111995Make the input method rules of Narayam testable....santhosh09:32, 21 February 2012

Status & tagging log