mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
FreeBSD compatibility patches (#11869)
# Description nushell is verified to work on FreeBSD 14 with these patches. What isn't supported on FreeBSD: * the crate 'procfs' doesn't support FreeBSD yet, all functionality depending on procfs is disabled * several RLIMIT_* values aren't supported on FreeBSD - functions related to these are disabled # User-Facing Changes n/a # Tests + Formatting n/a # After Submitting n/a --------- Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
@ -603,7 +603,7 @@ fn list_a_directory_not_exists() {
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
#[test]
|
||||
fn list_directory_contains_invalid_utf8() {
|
||||
use std::ffi::OsStr;
|
||||
|
@ -436,19 +436,19 @@ fn mv_change_case_of_directory() {
|
||||
.map(|de| de.unwrap().file_name().to_string_lossy().into_owned())
|
||||
.collect();
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
assert!(
|
||||
!_files_in_test_directory.contains(&original_dir)
|
||||
&& _files_in_test_directory.contains(&new_dir)
|
||||
);
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
assert!(files_exist_at(
|
||||
vec!["somefile.txt",],
|
||||
dirs.test().join(new_dir)
|
||||
));
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
#[cfg(not(any(target_os = "linux", target_os = "freebsd")))]
|
||||
_actual.err.contains("to a subdirectory of itself");
|
||||
})
|
||||
}
|
||||
@ -474,12 +474,12 @@ fn mv_change_case_of_file() {
|
||||
.unwrap()
|
||||
.map(|de| de.unwrap().file_name().to_string_lossy().into_owned())
|
||||
.collect();
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
assert!(
|
||||
!_files_in_test_directory.contains(&original_file_name)
|
||||
&& _files_in_test_directory.contains(&new_file_name)
|
||||
);
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
#[cfg(not(any(target_os = "linux", target_os = "freebsd")))]
|
||||
_actual.err.contains("are the same file");
|
||||
})
|
||||
}
|
||||
|
@ -903,7 +903,7 @@ fn test_cp_debug_default() {
|
||||
{
|
||||
panic!("{}", format!("Failure: stdout was \n{}", actual.out));
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
if !actual
|
||||
.out
|
||||
.contains("copy offload: unknown, reflink: unsupported, sparse detection: no")
|
||||
|
@ -93,7 +93,7 @@ fn limit_set_invalid1() {
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))]
|
||||
#[test]
|
||||
fn limit_set_invalid2() {
|
||||
Playground::setup("limit_set_invalid2", |dirs, _sandbox| {
|
||||
|
Reference in New Issue
Block a user