test (backend-rs): fix version format
This commit is contained in:
parent
0f4c05a64f
commit
8c22b0d07f
1 changed files with 5 additions and 5 deletions
|
@ -61,9 +61,9 @@ mod unit_test {
|
||||||
use crate::database::cache;
|
use crate::database::cache;
|
||||||
|
|
||||||
fn validate_version(version: String) {
|
fn validate_version(version: String) {
|
||||||
// version: YYYYMMDD
|
// version: YYYYMMDD or YYYYMMDD-X
|
||||||
assert!(version.len() == 8);
|
assert!(version.len() >= 8);
|
||||||
assert!(version.chars().all(|c| c.is_ascii_digit()));
|
assert!(version[..8].chars().all(|c| c.is_ascii_digit()));
|
||||||
|
|
||||||
// YYYY
|
// YYYY
|
||||||
assert!(&version[..4] >= "2024");
|
assert!(&version[..4] >= "2024");
|
||||||
|
@ -73,8 +73,8 @@ mod unit_test {
|
||||||
assert!(&version[4..6] <= "12");
|
assert!(&version[4..6] <= "12");
|
||||||
|
|
||||||
// DD
|
// DD
|
||||||
assert!(&version[6..] >= "01");
|
assert!(&version[6..8] >= "01");
|
||||||
assert!(&version[6..] <= "31");
|
assert!(&version[6..8] <= "31");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|
Loading…
Reference in a new issue