From 284c8ce11957f11693e6b5026adc1a564d35e7e9 Mon Sep 17 00:00:00 2001 From: Laurent Balland-Poirier Date: Sun, 24 Jul 2016 23:30:46 +0200 Subject: [PATCH] tdf#101096 tdf#101147 Add qa tests for minute/month detection Test number formats of bug reports Test odd date formats which do not follow Excel detection Change-Id: Iaa6d25a0103cae5e3ddd76075a324240aa255c35 Reviewed-on: https://gerrit.libreoffice.org/27494 Tested-by: Jenkins Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- svl/qa/unit/svl.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 44878d8565d2..8fb241a940d5 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -1131,11 +1131,27 @@ void Test::testUserDefinedNumberFormats() sExpected = "-12.00 ;"; checkPreviewString(aFormatter, sCode, -12.0, eLang, sExpected); } - { // tdf#995339: detect SSMM as second minute - sCode = "SS:MM:HH DD/MM/YY"; // Month not detected by Excel, but we do not follow that. + { // tdf#95339: detect SSMM as second minute + sCode = "SS:MM:HH DD/MM/YY"; // Month not detected by Excel, but we do not follow that. sExpected = "54:23:03 02/01/00"; checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected); } + { // tdf#101147: detect SSMM as second month + sCode = "HH:MM:SS MM/DD"; + sExpected = "03:23:54 01/02"; + checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected); + } + { // tdf#101096: different detection of month/minute with Excel + sCode = "HH DD MM"; // month detectected because of previous DD + sExpected = "03 02 01"; + checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected); + sCode = "HH:MM HH DD/MM"; // month detected because of previous DD + sExpected = "03:23 03 02/01"; + checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected); + sCode = "SS:DD-MM-YY SS:MM"; // 1st is month, because of previous DD; 2nd is minute as SS has not minute + sExpected = "54:02-01-00 54:23"; + checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected); + } { // tdf#99996: better algorithm for fraction representation sCode = "# ?/???"; sExpected = "-575 540/697";