r95262 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95261‎ | r95262 | r95263 >
Date:22:15, 22 August 2011
Author:wikinaut
Status:resolved (Comments)
Tags:
Comment:
follow up to r94807 : more test cases incl. hebrew RTL and Japanese, the test cases 100 and 101 have been intentionally added with wrong expected result. It shows that the current qunit software may have problems with wrong double closing span tags. test cases 100 and 101 fail *correctly* on internet explorer 8.0, but with Firefox 6.0 and Chrome no errors are detected --- false negative with Firefox and Chrome and maybe other browsers
Modified paths:
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js
@@ -8,110 +8,154 @@
99 test( 'Check', function() {
1010 var cases = [
1111 {
 12+ desc: 'Test 001',
1213 text: 'Blue Öyster Cult',
1314 highlight: 'Blue',
1415 expected: '<span class="highlight">Blue</span> Öyster Cult'
1516 },
1617 {
 18+ desc: 'Test 002',
1719 text: 'Blue Öyster Cult',
1820 highlight: 'Blue ',
1921 expected: '<span class="highlight">Blue</span> Öyster Cult'
2022 },
2123 {
 24+ desc: 'Test 003',
2225 text: 'Blue Öyster Cult',
2326 highlight: 'Blue Ö',
2427 expected: '<span class="highlight">Blue</span> <span class="highlight">Ö</span>yster Cult'
2528 },
2629 {
 30+ desc: 'Test 004',
2731 text: 'Blue Öyster Cult',
2832 highlight: 'Blue Öy',
2933 expected: '<span class="highlight">Blue</span> <span class="highlight">Öy</span>ster Cult'
3034 },
3135 {
 36+ desc: 'Test 005',
3237 text: 'Blue Öyster Cult',
3338 highlight: ' Blue',
3439 expected: '<span class="highlight">Blue</span> Öyster Cult'
3540 },
3641 {
 42+ desc: 'Test 006',
3743 text: 'Blue Öyster Cult',
3844 highlight: ' Blue ',
3945 expected: '<span class="highlight">Blue</span> Öyster Cult'
4046 },
4147 {
 48+ desc: 'Test 007',
4249 text: 'Blue Öyster Cult',
4350 highlight: ' Blue Ö',
4451 expected: '<span class="highlight">Blue</span> <span class="highlight">Ö</span>yster Cult'
4552 },
4653 {
 54+ desc: 'Test 008',
4755 text: 'Blue Öyster Cult',
4856 highlight: ' Blue Öy',
4957 expected: '<span class="highlight">Blue</span> <span class="highlight">Öy</span>ster Cult'
5058 },
5159 {
52 - desc: 'Highlighter broken on starting Umlaut?',
 60+ desc: 'Test 009: Highlighter broken on starting Umlaut?',
5361 text: 'Österreich',
5462 highlight: 'Österreich',
5563 expected: '<span class="highlight">Österreich</span>'
5664 },
5765 {
58 - desc: 'Highlighter broken on starting Umlaut?',
 66+ desc: 'Test 010: Highlighter broken on starting Umlaut?',
5967 text: 'Österreich',
6068 highlight: 'Ö',
61 - expected: '<span class="highlight">Ö</span>sterreich</span>'
 69+ expected: '<span class="highlight">Ö</span>sterreich'
6270 },
6371 {
64 - desc: 'Highlighter broken on starting Umlaut?',
 72+ desc: 'Test 011: Highlighter broken on starting Umlaut?',
6573 text: 'Österreich',
6674 highlight: 'Öst',
6775 expected: '<span class="highlight">Öst</span>erreich'
6876 },
6977 {
70 - desc: 'Highlighter broken on starting Umlaut?',
 78+ desc: 'Test 012: Highlighter broken on starting Umlaut?',
7179 text: 'Österreich',
7280 highlight: 'Oe',
7381 expected: 'Österreich'
7482 },
7583 {
76 - desc: 'Highlighter broken on punctuation mark?',
 84+ desc: 'Test 013: Highlighter broken on punctuation mark?',
7785 text: 'So good. To be there',
7886 highlight: 'good',
7987 expected: 'So <span class="highlight">good</span>. To be there'
8088 },
8189 {
82 - desc: 'Highlighter broken on space?',
 90+ desc: 'Test 014: Highlighter broken on space?',
8391 text: 'So good. To be there',
8492 highlight: 'be',
8593 expected: 'So good. To <span class="highlight">be</span> there'
8694 },
8795 {
88 - desc: 'Highlighter broken on space?',
 96+ desc: 'Test 015: Highlighter broken on space?',
8997 text: 'So good. To be there',
9098 highlight: ' be',
9199 expected: 'So good. To <span class="highlight">be</span> there'
92100 },
93101 {
94 - desc: 'Highlighter broken on space?',
 102+ desc: 'Test 016: Highlighter broken on space?',
95103 text: 'So good. To be there',
96104 highlight: 'be ',
97105 expected: 'So good. To <span class="highlight">be</span> there'
98106 },
99107 {
100 - desc: 'Highlighter broken on space?',
 108+ desc: 'Test 017: Highlighter broken on space?',
101109 text: 'So good. To be there',
102110 highlight: ' be ',
103111 expected: 'So good. To <span class="highlight">be</span> there'
104112 },
105113 {
106 - desc: 'Highlighter broken on special character at the end?',
 114+ desc: 'Test 018: Highlighter broken on special character at the end?',
107115 text: 'So good. xbß',
108116 highlight: 'xbß',
109117 expected: 'So good. <span class="highlight">xbß</span>'
110118 },
111119 {
112 - desc: 'Highlighter broken on special character at the end?',
 120+ desc: 'Test 019: Highlighter broken on special character at the end?',
113121 text: 'So good. xbß.',
114122 highlight: 'xbß.',
115123 expected: 'So good. <span class="highlight">xbß.</span>'
 124+ },
 125+ {
 126+ desc: 'Test 020: Hebrew',
 127+ text: 'חסיד אומות העולם',
 128+ highlight: 'חסיד אומות העולם',
 129+ expected: '<span class="highlight">חסיד</span> <span class="highlight">אומות</span> <span class="highlight">העולם</span>'
 130+ },
 131+ {
 132+ desc: 'Test 021: Hebrew',
 133+ text: 'חסיד אומות העולם',
 134+ highlight: 'חסי',
 135+ expected: '<span class="highlight">חסי</span>ד אומות העולם'
 136+ },
 137+ {
 138+ desc: 'Test 022: Japanese',
 139+ text: '諸国民の中の正義の人',
 140+ highlight: '諸国民の中の正義の人',
 141+ expected: '<span class="highlight">諸国民の中の正義の人</span>'
 142+ },
 143+ {
 144+ desc: 'Test 023: Japanese',
 145+ text: '諸国民の中の正義の人',
 146+ highlight: '諸国',
 147+ expected: '<span class="highlight">諸国</span>民の中の正義の人'
 148+ },
 149+ {
 150+ desc: 'Test 100: TESTCASE FOR QUNIT FAILS: a wrong expected string was not detected in Firefox 6.0 and Chrome',
 151+ text: 'Österreich',
 152+ highlight: 'Ö',
 153+ expected: '<span class="highlight">Ö</span>sterreich</span this wrong tag is not detected as test failure in Firefox 6.0 or Chrome>'
 154+ },
 155+ {
 156+ desc: 'Test 101: TESTCASE FOR QUNIT FAILS: a wrong expected string was not detected in Firefox 6.0 or Chrome',
 157+ text: 'Oesterreich',
 158+ highlight: 'Oe',
 159+ expected: '<span class="highlight">Oe</span>sterreich</span this wrong tag is not detected as test failure in Firefox 6.0 or Chrome>'
116160 }
117161 ];
118162 expect(cases.length);

Follow-up revisions

RevisionCommit summaryAuthorDate
r95299jquery.highlightText.js : test cases for French addedwikinaut07:28, 23 August 2011
r95315Followup r95262 - remove bogus test cases that seemed to be trying to test th...brion17:58, 23 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90092fix for bug29371 . regex wordwrap with UTF8: do not use \b metacharacter. The...wikinaut21:42, 14 June 2011
r94807more test cases for highlighter; all pass the test of coursewikinaut20:00, 17 August 2011

Comments

#Comment by Wikinaut (talk | contribs)   22:18, 22 August 2011

test cases 100 and 101 should be removed when the issue with qunit test failing with certain but not all browsers has been solved.

#Comment by Wikinaut (talk | contribs)   22:19, 22 August 2011

provisionally marked as fixme , as long as testcases 100 and 101 are in.

#Comment by Wikinaut (talk | contribs)   22:24, 22 August 2011
#Comment by Brion VIBBER (talk | contribs)   18:01, 23 August 2011

There's no qunit issue; just the 'supposed to fail' test cases you tried to use normalize to the actual expected value when HTML-parsed. :)

Removed them in r95315, as they serve no purpose.

#Comment by Wikinaut (talk | contribs)   18:13, 23 August 2011

then, please can someone "ok" this r95262 ?

Status & tagging log