mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 17:58:06 +00:00
403a6a3935
- ref: <https://users.rust-lang.org/t/imports-can-only-refer-to-extern-crate-names/24388> @@ <https://archive.is/iCaXp>
48 lines
1.2 KiB
Rust
48 lines
1.2 KiB
Rust
use crate::common::util::*;
|
|
|
|
#[test]
|
|
fn test_with_tab() {
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
let result = ucmd.arg("with-tab.txt").run();
|
|
assert!(result.success);
|
|
assert!(result.stdout.contains(" "));
|
|
assert!(!result.stdout.contains("\t"));
|
|
}
|
|
|
|
#[test]
|
|
fn test_with_trailing_tab() {
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
let result = ucmd.arg("with-trailing-tab.txt").run();
|
|
assert!(result.success);
|
|
assert!(result.stdout.contains("with tabs=> "));
|
|
assert!(!result.stdout.contains("\t"));
|
|
}
|
|
|
|
#[test]
|
|
fn test_with_trailing_tab_i() {
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
let result = ucmd.arg("with-trailing-tab.txt").arg("-i").run();
|
|
assert!(result.success);
|
|
assert!(result.stdout.contains(" // with tabs=>\t"));
|
|
}
|
|
|
|
#[test]
|
|
fn test_with_tab_size() {
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
let result = ucmd.arg("with-tab.txt").arg("--tabs=10").run();
|
|
assert!(result.success);
|
|
assert!(result.stdout.contains(" "));
|
|
}
|
|
|
|
#[test]
|
|
fn test_with_space() {
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
let result = ucmd.arg("with-spaces.txt").run();
|
|
assert!(result.success);
|
|
assert!(result.stdout.contains(" return"));
|
|
}
|