1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #1836 from aspenluxxxy/ios-compat

Change target_os = "macos" to target_vendor = "apple"
This commit is contained in:
Sylvestre Ledru 2021-03-18 14:37:26 +01:00 committed by GitHub
commit a482e28798
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 54 additions and 64 deletions

View file

@ -115,7 +115,7 @@ fn test_reference() {
}
#[test]
#[cfg(target_os = "macos")]
#[cfg(target_vendor = "apple")]
fn test_reference() {
new_ucmd!()
.arg("-v")

View file

@ -12,7 +12,7 @@ fn test_du_basics() {
assert!(result.success);
assert_eq!(result.stderr, "");
}
#[cfg(target_os = "macos")]
#[cfg(target_vendor = "apple")]
fn _du_basics(s: String) {
let answer = "32\t./subdir
8\t./subdir/deeper
@ -21,7 +21,7 @@ fn _du_basics(s: String) {
";
assert_eq!(s, answer);
}
#[cfg(not(target_os = "macos"))]
#[cfg(not(target_vendor = "apple"))]
fn _du_basics(s: String) {
let answer = "28\t./subdir
8\t./subdir/deeper
@ -41,11 +41,11 @@ fn test_du_basics_subdir() {
_du_basics_subdir(result.stdout);
}
#[cfg(target_os = "macos")]
#[cfg(target_vendor = "apple")]
fn _du_basics_subdir(s: String) {
assert_eq!(s, "4\tsubdir/deeper\n");
}
#[cfg(not(target_os = "macos"))]
#[cfg(not(target_vendor = "apple"))]
fn _du_basics_subdir(s: String) {
// MS-WSL linux has altered expected output
if !is_wsl() {
@ -80,12 +80,12 @@ fn test_du_soft_link() {
_du_soft_link(result.stdout);
}
#[cfg(target_os = "macos")]
#[cfg(target_vendor = "apple")]
fn _du_soft_link(s: String) {
// 'macos' host variants may have `du` output variation for soft links
assert!((s == "12\tsubdir/links\n") || (s == "16\tsubdir/links\n"));
}
#[cfg(not(target_os = "macos"))]
#[cfg(not(target_vendor = "apple"))]
fn _du_soft_link(s: String) {
// MS-WSL linux has altered expected output
if !is_wsl() {
@ -109,11 +109,11 @@ fn test_du_hard_link() {
_du_hard_link(result.stdout);
}
#[cfg(target_os = "macos")]
#[cfg(target_vendor = "apple")]
fn _du_hard_link(s: String) {
assert_eq!(s, "12\tsubdir/links\n")
}
#[cfg(not(target_os = "macos"))]
#[cfg(not(target_vendor = "apple"))]
fn _du_hard_link(s: String) {
// MS-WSL linux has altered expected output
if !is_wsl() {
@ -133,11 +133,11 @@ fn test_du_d_flag() {
_du_d_flag(result.stdout);
}
#[cfg(target_os = "macos")]
#[cfg(target_vendor = "apple")]
fn _du_d_flag(s: String) {
assert_eq!(s, "16\t./subdir\n20\t./\n");
}
#[cfg(not(target_os = "macos"))]
#[cfg(not(target_vendor = "apple"))]
fn _du_d_flag(s: String) {
// MS-WSL linux has altered expected output
if !is_wsl() {

View file

@ -11,7 +11,7 @@ fn test_hostname() {
}
// FixME: fails for "MacOS"
#[cfg(not(target_os = "macos"))]
#[cfg(not(target_vendor = "apple"))]
#[test]
fn test_hostname_ip() {
let result = new_ucmd!().arg("-i").run();

View file

@ -285,7 +285,7 @@ fn test_ls_ls_color() {
scene.ucmd().arg("--color=never").arg("z").succeeds();
}
#[cfg(not(any(target_os = "macos", target_os = "windows")))] // Truncate not available on mac or win
#[cfg(not(any(target_vendor = "apple", target_os = "windows")))] // Truncate not available on mac or win
#[test]
fn test_ls_human() {
let scene = TestScenario::new(util_name!());