r111725 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111724‎ | r111725 | r111726 >
Date:04:50, 17 February 2012
Author:santhosh
Status:resolved (Comments)
Tags:i18nreview 
Comment:
Qunit test cases for the grammar support in mw.jqueryMsg added in r111646
Modified paths:
  • /branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js (modified) (history)

Diff [purge]

Index: branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
@@ -41,3 +41,14 @@
4242 ok( mw.messages.set( 'gender-msg-wrong', '{{gender}} is awesome' ), 'mw.messages.set: Register' );
4343 equal( parser( 'gender-msg-wrong', 'female' ) , ' is awesome', 'Wrong syntax used, but ignore the {{gender}}' );
4444 } );
 45+
 46+test( 'mw.jqueryMsg Grammar', function() {
 47+ expect( 5 );
 48+ var parser = mw.jqueryMsg.getMessageFunction();
 49+ ok( parser, 'Parser Function initialized' );
 50+ ok( mw.messages.set( 'grammar-msg', 'Przeszukaj {{GRAMMAR:genitive|{{SITENAME}}}}' ), 'mw.messages.set: Register' );
 51+ equal( parser( 'grammar-msg' ) , 'Przeszukaj ' + mw.config.get( 'wgSiteName' ) , 'Grammar Test with sitename' );
 52+ ok( mw.messages.set( 'grammar-msg-wrong-syntax', 'Przeszukaj {{GRAMMAR:genitive}}' ), 'mw.messages.set: Register' );
 53+ equal( parser( 'grammar-msg-wrong-syntax' ) , 'Przeszukaj ' , 'Grammar Test with wrong grammar template syntax' );
 54+} );
 55+

Follow-up revisions

RevisionCommit summaryAuthorDate
r111934Avoid unconditional modification of original word in fi convertGrammar...santhosh15:09, 20 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111646Add grammar parsing support for mw.jqueryMsg...santhosh15:57, 16 February 2012

Comments

#Comment by Amire80 (talk | contribs)   21:56, 19 February 2012

The test descriptions are not really clear. "Przeszukaj" is "search", but the description says "register"; is it supposed to be related?

#Comment by Santhosh.thottingal (talk | contribs)   04:02, 20 February 2012

It means we registered a new message to mw.messages collection.

#Comment by Nikerabbit (talk | contribs)   14:10, 20 February 2012

These tests fail if site lang = fi for example, because it has different genitive form, and the latter test dies "cannot call match of undefined".

#Comment by Siebrand (talk | contribs)   23:45, 26 February 2012

Has this comment been addressed?

#Comment by Santhosh.thottingal (talk | contribs)   03:23, 27 February 2012

Yes, in r111934

Status & tagging log