time: add more detailed error descriptions, add custom format parsing with time.parse_format (#18257)

This commit is contained in:
sandbankdisperser 2023-06-06 17:43:10 +02:00 committed by GitHub
parent 0bbbf1e801
commit e97aff8742
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 438 additions and 27 deletions

View file

@ -404,6 +404,13 @@ fn test_contains_any() {
assert !''.contains_any('')
}
fn test_contains_only() {
assert '23885'.contains_only('0123456789')
assert '23gg885'.contains_only('01g23456789')
assert !'hello;'.contains_only('hello')
assert !''.contains_only('')
}
fn test_contains_any_substr() {
s := 'Some random text'
assert s.contains_any_substr(['false', 'not', 'rand'])