summaryrefslogtreecommitdiff
path: root/svl/qa
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-10-02 17:35:59 +0200
committerEike Rathke <erack@redhat.com>2017-10-02 17:36:30 +0200
commit5478d5d851721f041701dbe0bdd4d2f626fcf6c0 (patch)
treeaceb9cabdca2a7f2dc9f1c497fbf063a6b7381e1 /svl/qa
parent9b14d2ca8f0c11feb991142e1a0da819aa0e5c38 (diff)
Add unit tests for ISO 8601 date+time input
Change-Id: Iab53f39313c1bac04fe5718823455e5ef0e52f13
Diffstat (limited to 'svl/qa')
-rw-r--r--svl/qa/unit/svl.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 4cd89b0a95a4..97726d52823b 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -1101,7 +1101,16 @@ void Test::testIsNumberFormat()
{ "5-12-14", false },
{ "005-12-14", true },
{ "15-10-30", true },
- { "2015-10-30", true }
+ { "2015-10-30", true },
+ { "1999-11-23T12:34:56", true },
+ { "1999-11-23 12:34:56", true },
+ { "1999-11-23T12:34:56.789", true },
+ { "1999-11-23T12:34:56,789", true }, // ISO 8601 defines both dot and comma as fractional separator
+ { "1999-11-23 12:34:56.789", true },
+ { "1999-11-23 12:34:56,789", false }, // comma not in en-US if 'T' separator is not present,
+ // debatable, 'T' "may be omitted by mutual consent of those
+ // interchanging data, if ambiguity can be avoided."
+ { "1999-11-23T12:34:56/789", false }
};
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)