From: Thomas Gries Date: Wed, 17 Aug 2011 20:00:44 +0000 (+0000) Subject: more test cases for highlighter; all pass the test of course X-Git-Tag: 1.31.0-rc.0~28208 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=da60ce7d7e8cfdcbef119d778f9b182a51c5e5ae;p=lhc%2Fweb%2Fwiklou.git more test cases for highlighter; all pass the test of course --- diff --git a/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js b/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js index 6eacad0f14..5b1d5f8b06 100644 --- a/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js @@ -13,15 +13,105 @@ test( 'Check', function() { expected: 'Blue Öyster Cult' }, { + text: 'Blue Öyster Cult', + highlight: 'Blue ', + expected: 'Blue Öyster Cult' + }, + { + text: 'Blue Öyster Cult', + highlight: 'Blue Ö', + expected: 'Blue Öyster Cult' + }, + { + text: 'Blue Öyster Cult', + highlight: 'Blue Öy', + expected: 'Blue Öyster Cult' + }, + { + text: 'Blue Öyster Cult', + highlight: ' Blue', + expected: 'Blue Öyster Cult' + }, + { + text: 'Blue Öyster Cult', + highlight: ' Blue ', + expected: 'Blue Öyster Cult' + }, + { + text: 'Blue Öyster Cult', + highlight: ' Blue Ö', + expected: 'Blue Öyster Cult' + }, + { + text: 'Blue Öyster Cult', + highlight: ' Blue Öy', + expected: 'Blue Öyster Cult' + }, + { + desc: 'Highlighter broken on starting Umlaut?', text: 'Österreich', highlight: 'Österreich', expected: 'Österreich' }, { - desc: 'Highlighter broken on punctuation mark', + desc: 'Highlighter broken on starting Umlaut?', + text: 'Österreich', + highlight: 'Ö', + expected: 'Österreich' + }, + { + desc: 'Highlighter broken on starting Umlaut?', + text: 'Österreich', + highlight: 'Öst', + expected: 'Österreich' + }, + { + desc: 'Highlighter broken on starting Umlaut?', + text: 'Österreich', + highlight: 'Oe', + expected: 'Österreich' + }, + { + desc: 'Highlighter broken on punctuation mark?', text: 'So good. To be there', highlight: 'good', expected: 'So good. To be there' + }, + { + desc: 'Highlighter broken on space?', + text: 'So good. To be there', + highlight: 'be', + expected: 'So good. To be there' + }, + { + desc: 'Highlighter broken on space?', + text: 'So good. To be there', + highlight: ' be', + expected: 'So good. To be there' + }, + { + desc: 'Highlighter broken on space?', + text: 'So good. To be there', + highlight: 'be ', + expected: 'So good. To be there' + }, + { + desc: 'Highlighter broken on space?', + text: 'So good. To be there', + highlight: ' be ', + expected: 'So good. To be there' + }, + { + desc: 'Highlighter broken on special character at the end?', + text: 'So good. xbß', + highlight: 'xbß', + expected: 'So good. xbß' + }, + { + desc: 'Highlighter broken on special character at the end?', + text: 'So good. xbß.', + highlight: 'xbß.', + expected: 'So good. xbß.' } ]; expect(cases.length);