mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tests ~ reorganize tests
This commit is contained in:
parent
1c88bc8c45
commit
de0375f909
75 changed files with 0 additions and 0 deletions
48
tests/by-util/test_expand.rs
Normal file
48
tests/by-util/test_expand.rs
Normal file
|
@ -0,0 +1,48 @@
|
|||
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"));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue