From 0083c7c5107f00c8c6a85bd4aa9963b8907e4c83 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 13 Jun 2014 14:35:36 +0000 Subject: [PATCH] fpspreadsheet: Add to the numformatparser test some more complicated formatting strings found in Excel files -> passed. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3165 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../tests/numformatparsertests.pas | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/components/fpspreadsheet/tests/numformatparsertests.pas b/components/fpspreadsheet/tests/numformatparsertests.pas index c8fb68cc3..aed776962 100644 --- a/components/fpspreadsheet/tests/numformatparsertests.pas +++ b/components/fpspreadsheet/tests/numformatparsertests.pas @@ -23,7 +23,7 @@ type end; var - ParserTestData: Array[0..5] of TParserTestData; + ParserTestData: Array[0..8] of TParserTestData; procedure InitParserTestData; @@ -98,15 +98,31 @@ begin SollDecimals := 0; SollCurrencySymbol := ''; end; - { - with ParserTestData[4] do begin - FormatString := '#,##0.00 "$";-#,##0.00 "$";0.00 "$"'; - SollFormatString := '#,##0.00 "$";-#,##0.00 "$";0.00 "$"'; + with ParserTestData[6] do begin + FormatString := '[$-409]hh:mm:ss\ AM/PM;@'; + SollFormatString := 'hh:nn:ss AM/PM'; + SollNumFormat := nfLongTimeAM; + SollSectionCount := 2; + SollDecimals := 0; + SollCurrencySymbol := ''; + end; + with ParserTestData[7] do begin + FormatString := '[$-F400]dd.mm.yy\ hh:mm'; + SollFormatString := 'dd.mm.yy hh:nn'; + SollNumFormat := nfShortDateTime; + SollSectionCount := 1; + SollDecimals := 0; + SollCurrencySymbol := ''; + end; + with ParserTestData[8] do begin + FormatString := '[$€] #,##0.00;-[$€] #,##0.00;{$€} 0.00'; + SollFormatString := '"€" #,##0.00;-"€" #,##0.00;"€" 0.00'; SollNumFormat := nfCurrency; SollSectionCount := 3; SollDecimals := 2; - SollCurrencySymbol := '$'; + SollCurrencySymbol := '€'; end; + { with ParserTestData[5] do begin FormatString := '#,##0.00 "$";-#,##0.00 "$";-'; SollFormatString := '#,##0.00 "$";-#,##0.00 "$";-';