From da60ce7d7e8cfdcbef119d778f9b182a51c5e5ae Mon Sep 17 00:00:00 2001 From: Thomas Gries Date: Wed, 17 Aug 2011 20:00:44 +0000 Subject: [PATCH] more test cases for highlighter; all pass the test of course --- .../jquery/jquery.highlightText.test.js | 92 ++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) 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); -- 2.20.1