Skip to content
Myr

Unit test for --type x

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by David Peter · parent 2cf8e7b · Browse files · 1 file+27 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+27 added−0 removed

  • tests:+27 added−0 removed

1 file+27 added−0 removed

modified:tests/tests.rs+27 added
561 unmodified lines
562563 te.assert_output(&["--type", "l"], "symlink");564}565566/// Test `--type executable`567#[cfg(unix)]568#[test]569fn test_type_executable() {570 use std::os::unix::fs::OpenOptionsExt;571572 let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);573574 fs::OpenOptions::new()575 .create(true)576 .write(true)577 .mode(0o777)578 .open(te.test_root().join("executable-file.sh"))579 .unwrap();580581 te.assert_output(&["--type", "executable"], "executable-file.sh");582583 te.assert_output(584 &["--type", "executable", "--type", "directory"],585 "executable-file.sh586 one587 one/two588 one/two/three589 one/two/three/directory_foo",590 );591}592593/// File extension (--extension)594#[test]595fn test_extension() {596 let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
344 unmodified lines