mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
date: change tests to expect failure (#1895)
* date: change tests to expect failure Although these tests contain valid dates, the parsing logic is not implemented yet. It should be changed to expect success when the parsing logic is done. * date: fix test build errors
This commit is contained in:
parent
4873c8a24b
commit
9b2ee1ce06
1 changed files with 12 additions and 6 deletions
|
@ -180,39 +180,45 @@ fn test_date_set_mac_unavailable() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(all(unix, not(target_os = "macos")))]
|
#[cfg(all(unix, not(target_os = "macos")))]
|
||||||
|
/// TODO: expected to fail currently; change to succeeds() when required.
|
||||||
fn test_date_set_valid_2() {
|
fn test_date_set_valid_2() {
|
||||||
if get_effective_uid() == 0 {
|
if get_effective_uid() == 0 {
|
||||||
let (_, mut ucmd) = at_and_ucmd!();
|
let (_, mut ucmd) = at_and_ucmd!();
|
||||||
let result = ucmd
|
let result = ucmd
|
||||||
.arg("--set")
|
.arg("--set")
|
||||||
.arg("Sat 20 Mar 2021 14:53:01 AWST")
|
.arg("Sat 20 Mar 2021 14:53:01 AWST")
|
||||||
.succeeds();
|
.fails();
|
||||||
result.no_stdout().no_stderr();
|
let result = result.no_stdout();
|
||||||
|
assert!(result.stderr.starts_with("date: invalid date "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(all(unix, not(target_os = "macos")))]
|
#[cfg(all(unix, not(target_os = "macos")))]
|
||||||
|
/// TODO: expected to fail currently; change to succeeds() when required.
|
||||||
fn test_date_set_valid_3() {
|
fn test_date_set_valid_3() {
|
||||||
if get_effective_uid() == 0 {
|
if get_effective_uid() == 0 {
|
||||||
let (_, mut ucmd) = at_and_ucmd!();
|
let (_, mut ucmd) = at_and_ucmd!();
|
||||||
let result = ucmd
|
let result = ucmd
|
||||||
.arg("--set")
|
.arg("--set")
|
||||||
.arg("Sat 20 Mar 2021 14:53:01") // Local timezone
|
.arg("Sat 20 Mar 2021 14:53:01") // Local timezone
|
||||||
.succeeds();
|
.fails();
|
||||||
result.no_stdout().no_stderr();
|
let result = result.no_stdout();
|
||||||
|
assert!(result.stderr.starts_with("date: invalid date "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(all(unix, not(target_os = "macos")))]
|
#[cfg(all(unix, not(target_os = "macos")))]
|
||||||
|
/// TODO: expected to fail currently; change to succeeds() when required.
|
||||||
fn test_date_set_valid_4() {
|
fn test_date_set_valid_4() {
|
||||||
if get_effective_uid() == 0 {
|
if get_effective_uid() == 0 {
|
||||||
let (_, mut ucmd) = at_and_ucmd!();
|
let (_, mut ucmd) = at_and_ucmd!();
|
||||||
let result = ucmd
|
let result = ucmd
|
||||||
.arg("--set")
|
.arg("--set")
|
||||||
.arg("2020-03-11 21:45:00") // Local timezone
|
.arg("2020-03-11 21:45:00") // Local timezone
|
||||||
.succeeds();
|
.fails();
|
||||||
result.no_stdout().no_stderr();
|
let result = result.no_stdout();
|
||||||
|
assert!(result.stderr.starts_with("date: invalid date "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue