summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArkadiusz Bielewicz <arkadiusz.bielewicz@allegro.pl>2021-10-13 13:13:32 +0200
committerAbin Simon <abinsimon10@gmail.com>2021-10-14 05:43:31 +0000
commit8037d5f4ce97b04c910bfa8b162e589dd20a3aed (patch)
tree8b7659e38f3397ae53aca2d1738816dd683f4736 /tests
parentc269d3c3373f17794faf662284e8ba390804ce68 (diff)
#532 Improve date format validation to include all supported cases | Added missing valid cases
Diffstat (limited to 'tests')
-rw-r--r--tests/integration.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/integration.rs b/tests/integration.rs
index 8eddc78..b3f8073 100644
--- a/tests/integration.rs
+++ b/tests/integration.rs
@@ -608,3 +608,19 @@ fn test_date_custom_format_supports_nanos_with_length() {
.assert()
.stdout(predicate::str::is_match("testDateFormat\\.[0-9]{3}").unwrap().count(2));
}
+
+#[test]
+fn test_date_custom_format_supports_padding() {
+ let dir = tempdir();
+ dir.child("one").touch().unwrap();
+ dir.child("two").touch().unwrap();
+
+ cmd()
+ .arg("-l")
+ .arg("--date")
+ .arg("+testDateFormat%_d")
+ .arg("--ignore-config")
+ .arg(dir.path())
+ .assert()
+ .stdout(predicate::str::is_match("testDateFormat[\\s0-9]{2}").unwrap().count(2));
+}