| 1 |
// For the full copyright and license information, please view the LICENSE |
| 2 |
// file that was distributed with this source code. |
| 3 |
|
| 4 |
mod common; |
| 5 |
|
| 6 |
use common::{check_absolute, check_relative}; |
| 7 |
use jiff::{civil::DateTime, tz::TimeZone}; |
| 8 |
|
| 9 |
#[test] |
| 10 |
fn helper_formats_extended_values() { |
| 11 |
check_absolute("10000-01-01", "10000-01-01 00:00:00+00:00"); |
| 12 |
} |
| 13 |
|
| 14 |
#[test] |
| 15 |
fn helper_formats_extended_rollover() { |
| 16 |
check_absolute("9999-12-31 +1 day", "10000-01-01 00:00:00+00:00"); |
| 17 |
} |
| 18 |
|
| 19 |
#[test] |
| 20 |
fn helper_formats_relative_extended_values() { |
| 21 |
let base = "2000-01-01 00:00:00" |
| 22 |
.parse::<DateTime>() |
| 23 |
.unwrap() |
| 24 |
.to_zoned(TimeZone::UTC) |
| 25 |
.unwrap(); |
| 26 |
check_relative(base, "10000-01-01 +1 day", "10000-01-02 00:00:00+00:00"); |
| 27 |
} |