1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +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

@ -1,5 +1,6 @@
use crate::common::util::*;
use std::env;
use uucore;
#[test]
fn test_normal() {
@ -13,7 +14,7 @@ fn test_normal() {
for (key, value) in env::vars() {
println!("{}: {}", key, value);
}
if (is_ci() || is_wsl()) && result.stderr.contains("error: no login name") {
if (is_ci() || uucore::os::is_wsl_1()) && result.stderr.contains("error: no login name") {
// ToDO: investigate WSL failure
// In the CI, some server are failing to return logname.
// As seems to be a configuration issue, ignoring it