1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

wsl2: wsl no longer differs in output

refactor `is_wsl` to `is_wsl_1` and `is_wsl_2`

On my tests with wsl2 ubuntu2004 all tests pass without special cases

I moved wsl detection into uucore so that it can be shared instead of duplicated

I moved `parse_mode` into uucode as it seemed to fit there better and anyway requires libc feature
This commit is contained in:
ReggaeMuffin 2021-04-06 09:44:57 +01:00
parent cc4f32d87a
commit b1fcb621a8
No known key found for this signature in database
GPG key ID: B7A56D7FE881B7C5
11 changed files with 84 additions and 84 deletions

View file

@ -4,6 +4,7 @@ use self::regex::Regex;
use crate::common::util::*;
#[cfg(all(unix, not(target_os = "macos")))]
use rust_users::*;
use uucore;
#[test]
fn test_date_email() {
@ -159,7 +160,7 @@ fn test_date_set_invalid() {
#[test]
#[cfg(all(unix, not(target_os = "macos")))]
fn test_date_set_permissions_error() {
if !(get_effective_uid() == 0 || is_wsl()) {
if !(get_effective_uid() == 0 || uucore::os::is_wsl_1()) {
let (_, mut ucmd) = at_and_ucmd!();
let result = ucmd.arg("--set").arg("2020-03-11 21:45:00+08:00").fails();
let result = result.no_stdout();