wip: nano second working and error handling

This commit is contained in:
Loïc Riegel
2025-03-30 12:44:33 +02:00
parent 12a1eefe73
commit 4587c8c9d4
3 changed files with 149 additions and 8 deletions

View File

@ -1,5 +1,15 @@
use nu_test_support::nu;
#[test]
fn into_datetime_from_record() {
let actual = nu!(
r#"{year: 2023, month: 1, day: 1, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0, timezone: "+01:00"} | into datetime"#
);
let expected = nu!(r#"'01/01/2023' | into datetime"#);
assert_eq!(expected.out, actual.out);
}
#[test]
fn into_datetime_table_column() {
let actual = nu!(r#"[[date]; ["2022-01-01"] ["2023-01-01"]] | into datetime date"#);