Skip to content

Commit 5c57e94

Browse files
gonzalemariosylvestre
authored andcommitted
tests/mv: Remove pub(crate) and redundant cfg(unix)
There is no need to use `pub(crate)` in this module, also, this follows convention found in other sources like test_cp.rs or test_ls.rs. The change about removing `cfg(unix)`, it's redundant because the parent inter_partition_copying already defines its targes as "linux", and we need to run those test_* functions when /dev/shm is available only.
1 parent 9499afc commit 5c57e94

1 file changed

Lines changed: 10 additions & 17 deletions

File tree

‎tests/by-util/test_mv.rs‎

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ mod inter_partition_copying {
19401940
// that needs a second uid, so it is exercised out of band rather than here.
19411941
#[uutests::wasi_ignore(HostPathsNotVisible)]
19421942
#[test]
1943-
pub(crate) fn test_mv_inter_partition_keeps_setuid_when_ownership_preserved() {
1943+
fn test_mv_inter_partition_keeps_setuid_when_ownership_preserved() {
19441944
let scene = TestScenario::new(util_name!());
19451945
let at = &scene.fixtures;
19461946

@@ -2083,7 +2083,7 @@ mod inter_partition_copying {
20832083
// Ensure that the copying code used in an inter-partition move unlinks the destination symlink.
20842084
#[uutests::wasi_ignore(HostPathsNotVisible)]
20852085
#[test]
2086-
pub(crate) fn test_mv_unlinks_dest_symlink() {
2086+
fn test_mv_unlinks_dest_symlink() {
20872087
let scene = TestScenario::new(util_name!());
20882088
let at = &scene.fixtures;
20892089

@@ -2133,7 +2133,7 @@ mod inter_partition_copying {
21332133
// that it would output the proper error message.
21342134
#[uutests::wasi_ignore(HostPathsNotVisible)]
21352135
#[test]
2136-
pub(crate) fn test_mv_unlinks_dest_symlink_error_message() {
2136+
fn test_mv_unlinks_dest_symlink_error_message() {
21372137
use uutests::util::TestScenario;
21382138
let scene = TestScenario::new(util_name!());
21392139
let at = &scene.fixtures;
@@ -2165,8 +2165,7 @@ mod inter_partition_copying {
21652165
// Test that hardlinks are preserved when moving files across partitions
21662166
#[uutests::wasi_ignore(HostPathsNotVisible)]
21672167
#[test]
2168-
#[cfg(unix)]
2169-
pub(crate) fn test_mv_preserves_hardlinks_across_partitions() {
2168+
fn test_mv_preserves_hardlinks_across_partitions() {
21702169
use std::fs;
21712170
use std::os::unix::fs::MetadataExt;
21722171
use tempfile::TempDir;
@@ -2240,10 +2239,9 @@ mod inter_partition_copying {
22402239
// Test that hardlinks are preserved even with multiple sets of hardlinked files
22412240
#[uutests::wasi_ignore(HostPathsNotVisible)]
22422241
#[test]
2243-
#[cfg(unix)]
22442242
#[allow(clippy::too_many_lines)]
22452243
#[allow(clippy::similar_names)]
2246-
pub(crate) fn test_mv_preserves_multiple_hardlink_groups_across_partitions() {
2244+
fn test_mv_preserves_multiple_hardlink_groups_across_partitions() {
22472245
use std::fs::metadata;
22482246
use std::os::unix::fs::MetadataExt;
22492247
use tempfile::TempDir;
@@ -2358,9 +2356,8 @@ mod inter_partition_copying {
23582356
#[rstest]
23592357
#[case::with_minus_t(true)]
23602358
#[case::without_minus_t(false)]
2361-
#[cfg(unix)]
23622359
#[uutests::wasi_ignore(HostPathsNotVisible)]
2363-
pub(crate) fn test_mv_preserves_hardlinks_in_directories_to_files_across_partitions(
2360+
fn test_mv_preserves_hardlinks_in_directories_to_files_across_partitions(
23642361
#[case] with_minus_t: bool,
23652362
) {
23662363
use std::fs::metadata;
@@ -2427,8 +2424,7 @@ mod inter_partition_copying {
24272424
// Test hardlinks within directories being moved
24282425
#[uutests::wasi_ignore(HostPathsNotVisible)]
24292426
#[test]
2430-
#[cfg(unix)]
2431-
pub(crate) fn test_mv_preserves_hardlinks_in_directories_across_partitions() {
2427+
fn test_mv_preserves_hardlinks_in_directories_across_partitions() {
24322428
use std::fs::metadata;
24332429
use std::os::unix::fs::MetadataExt;
24342430
use tempfile::TempDir;
@@ -2528,10 +2524,9 @@ mod inter_partition_copying {
25282524
// Test complex scenario with multiple hardlink groups across nested directories
25292525
#[uutests::wasi_ignore(HostPathsNotVisible)]
25302526
#[test]
2531-
#[cfg(unix)]
25322527
#[allow(clippy::too_many_lines)]
25332528
#[allow(clippy::similar_names)]
2534-
pub(crate) fn test_mv_preserves_complex_hardlinks_across_nested_directories() {
2529+
fn test_mv_preserves_complex_hardlinks_across_nested_directories() {
25352530
use std::fs::metadata;
25362531
use std::os::unix::fs::MetadataExt;
25372532
use tempfile::TempDir;
@@ -2677,8 +2672,7 @@ mod inter_partition_copying {
26772672

26782673
#[uutests::wasi_ignore(HostPathsNotVisible)]
26792674
#[test]
2680-
#[cfg(unix)]
2681-
pub(crate) fn test_mv_dir_with_fifo_across_partitions() {
2675+
fn test_mv_dir_with_fifo_across_partitions() {
26822676
use std::os::unix::fs::FileTypeExt;
26832677
use tempfile::TempDir;
26842678
use uutests::util::TestScenario;
@@ -2711,8 +2705,7 @@ mod inter_partition_copying {
27112705
// self-referential symlinks and destroying the content.
27122706
#[uutests::wasi_ignore(HostPathsNotVisible)]
27132707
#[test]
2714-
#[cfg(unix)]
2715-
pub(crate) fn test_mv_symlink_to_hardlinked_sibling_across_partitions() {
2708+
fn test_mv_symlink_to_hardlinked_sibling_across_partitions() {
27162709
use std::os::unix::fs::MetadataExt;
27172710

27182711
let scene = TestScenario::new(util_name!());

0 commit comments

Comments
 (0)