mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
pinky: move unit test away from integration tests
This commit is contained in:
parent
68a0369a45
commit
5dc7b3d3f6
2 changed files with 15 additions and 9 deletions
|
|
@ -135,3 +135,16 @@ impl Capitalize for str {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_capitalize() {
|
||||
assert_eq!("Zbnmasd", "zbnmasd".capitalize()); // spell-checker:disable-line
|
||||
assert_eq!("Abnmasd", "Abnmasd".capitalize()); // spell-checker:disable-line
|
||||
assert_eq!("1masd", "1masd".capitalize()); // spell-checker:disable-line
|
||||
assert_eq!("", "".capitalize());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
|
||||
use pinky::Capitalize;
|
||||
#[cfg(not(target_os = "openbsd"))]
|
||||
use uucore::entries::{Locate, Passwd};
|
||||
use uutests::new_ucmd;
|
||||
|
|
@ -19,17 +18,11 @@ fn test_invalid_arg() {
|
|||
new_ucmd!().arg("--definitely-invalid").fails_with_code(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_capitalize() {
|
||||
assert_eq!("Zbnmasd", "zbnmasd".capitalize()); // spell-checker:disable-line
|
||||
assert_eq!("Abnmasd", "Abnmasd".capitalize()); // spell-checker:disable-line
|
||||
assert_eq!("1masd", "1masd".capitalize()); // spell-checker:disable-line
|
||||
assert_eq!("", "".capitalize());
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(target_os = "openbsd"))]
|
||||
fn test_long_format() {
|
||||
use pinky::Capitalize;
|
||||
|
||||
let login = "root";
|
||||
let pw: Passwd = Passwd::locate(login).unwrap();
|
||||
let user_info = pw.user_info.unwrap_or_default();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue