1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

ls: Reduce binary size of ls by removing regex crate (#2781)

This commit is contained in:
kimono-koans 2021-12-22 11:31:45 -06:00 committed by GitHub
parent f2f582aa14
commit fd64e01d92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 81 additions and 46 deletions

View file

@ -40,6 +40,35 @@ fn test_ls_i() {
}
#[test]
fn test_ls_walk_glob() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.touch(".test-1");
at.mkdir("some-dir");
at.touch(
Path::new("some-dir")
.join("test-2~")
.as_os_str()
.to_str()
.unwrap(),
);
#[allow(clippy::trivial_regex)]
let re_pwd = Regex::new(r"^\.\n").unwrap();
scene
.ucmd()
.arg("-1")
.arg("--ignore-backups")
.arg("some-dir")
.succeeds()
.stdout_does_not_contain("test-2~")
.stdout_does_not_contain("..")
.stdout_does_not_match(&re_pwd);
}
#[test]
#[cfg(unix)]
fn test_ls_a() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
@ -1903,6 +1932,7 @@ fn test_ls_ignore_hide() {
}
#[test]
#[cfg(unix)]
fn test_ls_ignore_backups() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;