Skip to content

Commit

Permalink
revert freebsd related stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
cre4ture committed Mar 13, 2024
1 parent da6604e commit 7f8cf75
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions tests/by-util/test_ls.rs
Original file line number Diff line number Diff line change
@@ -107,15 +107,15 @@ fn test_ls_allocation_size() {
// fill empty file with zeros
scene
.ccmd("dd")
.arg("if=/dev/random")
.arg("if=/dev/zero")
.arg("of=some-dir1/zero-file")
.arg("bs=1024")
.arg("count=4096")
.succeeds();

scene
.ccmd("dd")
.arg("if=/dev/random")
.arg("if=/dev/zero")
.arg("of=irregular-file")
.arg("bs=1")
.arg("count=777")
@@ -137,7 +137,8 @@ fn test_ls_allocation_size() {
};

Check failure on line 137 in tests/by-util/test_ls.rs

GitHub Actions / Style/format (ubuntu-latest, feat_os_unix)

ERROR: `cargo fmt`: style violation (file:'tests/by-util/test_ls.rs', line:137; use `cargo fmt -- "tests/by-util/test_ls.rs"`)

let zero_file_size_4k_filler = " ".repeat(zero_file_size_4k.to_string().len() - 1);


#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.arg("-s1")
@@ -154,6 +155,7 @@ fn test_ls_allocation_size() {
// block size is 0 whereas size/len is 4194304
.stdout_contains("4194304");

#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.arg("-s1")
@@ -187,6 +189,7 @@ fn test_ls_allocation_size() {

assert_eq!(empty_file_len, file_with_holes_len);

#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.env("LS_BLOCK_SIZE", "8K")
@@ -199,6 +202,7 @@ fn test_ls_allocation_size() {
.stdout_contains("0 file-with-holes")
.stdout_contains("512 zero-file");

#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.env("BLOCK_SIZE", "4K")
@@ -210,6 +214,7 @@ fn test_ls_allocation_size() {
.stdout_contains("0 file-with-holes")
.stdout_contains(format!("{zero_file_size_1k} zero-file"));

#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.env("BLOCK_SIZE", "4K")
@@ -222,6 +227,7 @@ fn test_ls_allocation_size() {
.stdout_contains("0 file-with-holes")
.stdout_contains("4.2M zero-file");

#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.env("BLOCK_SIZE", "4096")
@@ -233,6 +239,7 @@ fn test_ls_allocation_size() {
.stdout_contains("0 file-with-holes")
.stdout_contains(format!("{zero_file_size_1k} zero-file"));

#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.env("POSIXLY_CORRECT", "true")
@@ -245,6 +252,7 @@ fn test_ls_allocation_size() {
.stdout_contains(format!("{zero_file_size_8k} zero-file"));

// -k should make 'ls' ignore the env var
#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.env("BLOCK_SIZE", "4K")
@@ -257,6 +265,7 @@ fn test_ls_allocation_size() {
.stdout_contains(format!("{zero_file_size_4k} zero-file"));

// but manually specified blocksize overrides -k
#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.arg("-s1k")
@@ -268,6 +277,7 @@ fn test_ls_allocation_size() {
.stdout_contains("0 file-with-holes")
.stdout_contains(format!("{zero_file_size_1k} zero-file"));

#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.arg("-s1")
@@ -280,6 +290,7 @@ fn test_ls_allocation_size() {
.stdout_contains(format!("{zero_file_size_1k} zero-file"));

// si option should always trump the human-readable option
#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.arg("-s1h")
@@ -291,6 +302,7 @@ fn test_ls_allocation_size() {
.stdout_contains("0 file-with-holes")
.stdout_contains("4.2M zero-file");

#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.arg("-s1")
@@ -302,6 +314,7 @@ fn test_ls_allocation_size() {
.stdout_contains("0 file-with-holes")
.stdout_contains(format!("{zero_file_size_4m} zero-file"));

#[cfg(not(target_os = "freebsd"))]
scene
.ucmd()
.arg("-s1")
@@ -4070,7 +4083,7 @@ fn test_ls_block_size_override() {

scene
.ccmd("dd")
.arg("if=/dev/random")
.arg("if=/dev/zero")
.arg("of=file")
.arg("bs=1024")
.arg("count=1")

0 comments on commit 7f8cf75

Please sign in to comment.