mirror of
https://github.com/nushell/nushell.git
synced 2025-05-30 06:39:33 +02:00
fix tests
This commit is contained in:
parent
a28720e258
commit
5aec266159
@ -772,7 +772,10 @@ mod tests {
|
||||
#[test]
|
||||
fn takes_a_date_format_with_timezone() {
|
||||
let date_str = Value::test_string("16.11.1984 8:00 am +0000");
|
||||
let fmt_options = Some(DatetimeFormat("%d.%m.%Y %H:%M %P %z".to_string()));
|
||||
let fmt_options = Some(Spanned {
|
||||
item: DatetimeFormat("%d.%m.%Y %H:%M %P %z".to_string()),
|
||||
span: Span::test_data(),
|
||||
});
|
||||
let args = Arguments {
|
||||
zone_options: None,
|
||||
format_options: fmt_options,
|
||||
@ -789,7 +792,10 @@ mod tests {
|
||||
#[test]
|
||||
fn takes_a_date_format_without_timezone() {
|
||||
let date_str = Value::test_string("16.11.1984 8:00 am");
|
||||
let fmt_options = Some(DatetimeFormat("%d.%m.%Y %H:%M %P".to_string()));
|
||||
let fmt_options = Some(Spanned {
|
||||
item: DatetimeFormat("%d.%m.%Y %H:%M %P".to_string()),
|
||||
span: Span::test_data(),
|
||||
});
|
||||
let args = Arguments {
|
||||
zone_options: None,
|
||||
format_options: fmt_options,
|
||||
@ -871,7 +877,10 @@ mod tests {
|
||||
#[test]
|
||||
fn takes_int_with_formatstring() {
|
||||
let date_int = Value::test_int(1_614_434_140);
|
||||
let fmt_options = Some(DatetimeFormat("%s".to_string()));
|
||||
let fmt_options = Some(Spanned {
|
||||
item: DatetimeFormat("%s".to_string()),
|
||||
span: Span::test_data(),
|
||||
});
|
||||
let args = Arguments {
|
||||
zone_options: None,
|
||||
format_options: fmt_options,
|
||||
@ -893,7 +902,10 @@ mod tests {
|
||||
item: Zone::East(8),
|
||||
span: Span::test_data(),
|
||||
});
|
||||
let fmt_options = Some(DatetimeFormat("%s".to_string()));
|
||||
let fmt_options = Some(Spanned {
|
||||
item: DatetimeFormat("%s".to_string()),
|
||||
span: Span::test_data(),
|
||||
});
|
||||
let args = Arguments {
|
||||
zone_options: timezone_option,
|
||||
format_options: fmt_options,
|
||||
@ -915,7 +927,10 @@ mod tests {
|
||||
item: Zone::Local,
|
||||
span: Span::test_data(),
|
||||
});
|
||||
let fmt_options = Some(DatetimeFormat("%s".to_string()));
|
||||
let fmt_options = Some(Spanned {
|
||||
item: DatetimeFormat("%s".to_string()),
|
||||
span: Span::test_data(),
|
||||
});
|
||||
let args = Arguments {
|
||||
zone_options: timezone_option,
|
||||
format_options: fmt_options,
|
||||
@ -991,7 +1006,10 @@ mod tests {
|
||||
#[test]
|
||||
fn communicates_parsing_error_given_an_invalid_datetimelike_string() {
|
||||
let date_str = Value::test_string("16.11.1984 8:00 am Oops0000");
|
||||
let fmt_options = Some(DatetimeFormat("%d.%m.%Y %H:%M %P %z".to_string()));
|
||||
let fmt_options = Some(Spanned {
|
||||
item: DatetimeFormat("%d.%m.%Y %H:%M %P %z".to_string()),
|
||||
span: Span::test_data(),
|
||||
});
|
||||
let args = Arguments {
|
||||
zone_options: None,
|
||||
format_options: fmt_options,
|
||||
|
Loading…
x
Reference in New Issue
Block a user