mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Adding tests for ls. Corrected issue with ls on the present directory throwing panic!()
This commit is contained in:
Generated
+20
@@ -35,6 +35,7 @@ dependencies = [
|
||||
"link 0.0.1",
|
||||
"ln 0.0.1",
|
||||
"logname 0.0.1",
|
||||
"ls 0.0.1",
|
||||
"memchr 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mkdir 0.0.1",
|
||||
"mkfifo 0.0.1",
|
||||
@@ -448,6 +449,16 @@ dependencies = [
|
||||
"uucore 0.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ls"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pretty-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uucore 0.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "0.1.7"
|
||||
@@ -571,6 +582,15 @@ dependencies = [
|
||||
"uucore 0.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pretty-bytes"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "primal"
|
||||
version = "0.2.3"
|
||||
|
||||
@@ -146,6 +146,7 @@ TEST_PROGS := \
|
||||
head \
|
||||
link \
|
||||
ln \
|
||||
ls \
|
||||
mkdir \
|
||||
mktemp \
|
||||
mv \
|
||||
|
||||
+1
-2
@@ -89,8 +89,7 @@ fn help() {
|
||||
|
||||
fn list(options: getopts::Matches) {
|
||||
let locs: Vec<String> = if options.free.is_empty() {
|
||||
show_error!("Missing DIRECTORY or FILES argument. Try --help.");
|
||||
panic!();
|
||||
vec![String::from(".")]
|
||||
} else {
|
||||
options.free.iter().cloned().collect()
|
||||
};
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#[macro_use]
|
||||
mod common;
|
||||
|
||||
use common::util::*;
|
||||
|
||||
static UTIL_NAME: &'static str = "ls";
|
||||
|
||||
#[test]
|
||||
fn test_ls_ls() {
|
||||
let (at, mut ucmd) = testing(UTIL_NAME);
|
||||
|
||||
let result = ucmd.run();
|
||||
|
||||
let exit_success = result.success;
|
||||
assert_eq!(exit_success, true);
|
||||
}
|
||||
Reference in New Issue
Block a user