From 4b3da59b0eb89ebd840d158cbab756ecdc82e936 Mon Sep 17 00:00:00 2001 From: Jan Scheer Date: Wed, 23 Jun 2021 12:27:01 +0200 Subject: [PATCH] id: refactor identifiers * change of identifier names and spelling according to the suggestions in the review of #2446 --- src/uu/id/src/id.rs | 8 ++++---- tests/by-util/test_id.rs | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/uu/id/src/id.rs b/src/uu/id/src/id.rs index 9037745eb..1c967ec12 100644 --- a/src/uu/id/src/id.rs +++ b/src/uu/id/src/id.rs @@ -13,11 +13,11 @@ // http://www.opensource.apple.com/source/shell_cmds/shell_cmds-118/id/id.c // // * This was partially rewritten in order for stdout/stderr/exit_code -// to be conform with GNU coreutils (8.32) testsuite for `id`. +// to be conform with GNU coreutils (8.32) test suite for `id`. // // * This supports multiple users (a feature that was introduced in coreutils 8.31) // -// * This passes GNU's coreutils Testsuite (8.32) +// * This passes GNU's coreutils Test suite (8.32) // for "tests/id/uid.sh" and "tests/id/zero/sh". // // * Option '--zero' does not exist for BSD's `id`, therefore '--zero' is only @@ -26,7 +26,7 @@ // * Help text based on BSD's `id` manpage and GNU's `id` manpage. // -// spell-checker:ignore (ToDO) asid auditid auditinfo auid cstr egid emod euid getaudit getlogin gflag nflag pline rflag termid uflag gsflag zflag testsuite +// spell-checker:ignore (ToDO) asid auditid auditinfo auid cstr egid emod euid getaudit getlogin gflag nflag pline rflag termid uflag gsflag zflag #![allow(non_camel_case_types)] #![allow(dead_code)] @@ -242,7 +242,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 { crash!(1, "cannot print only names or real IDs in default format"); } if (state.zflag) && default_format { - // NOTE: GNU testsuite "id/zero.sh" needs this stderr output: + // NOTE: GNU test suite "id/zero.sh" needs this stderr output: crash!(1, "option --zero not permitted in default format"); } diff --git a/tests/by-util/test_id.rs b/tests/by-util/test_id.rs index b4b929a2c..b0f48fe70 100644 --- a/tests/by-util/test_id.rs +++ b/tests/by-util/test_id.rs @@ -1,6 +1,6 @@ use crate::common::util::*; -// spell-checker:ignore (ToDO) testsuite coreutil +// spell-checker:ignore (ToDO) coreutil // These tests run the GNU coreutils `(g)id` binary in `$PATH` in order to gather reference values. // If the `(g)id` in `$PATH` doesn't include a coreutils version string, @@ -8,8 +8,8 @@ use crate::common::util::*; // The reference version is 8.32. Here 8.30 was chosen because right now there's no // ubuntu image for github action available with a higher version than 8.30. -const VERSION_EXPECTED: &str = "8.30"; // Version expected for the reference `id` in $PATH -const VERSION_MULTIPLE_USERS: &str = "8.31"; +const VERSION_MIN: &str = "8.30"; // minimum Version for the reference `id` in $PATH +const VERSION_MIN_MULTIPLE_USERS: &str = "8.31"; // this feature was introduced in GNU's coreutils 8.31 const UUTILS_WARNING: &str = "uutils-tests-warning"; const UUTILS_INFO: &str = "uutils-tests-info"; @@ -210,13 +210,13 @@ fn test_id_multiple_users() { let util_name = util_name!(); #[cfg(all(unix, not(target_os = "linux")))] let util_name = &format!("g{}", util_name!()); - let version_check_string = check_coreutil_version(util_name, VERSION_MULTIPLE_USERS); + let version_check_string = check_coreutil_version(util_name, VERSION_MIN_MULTIPLE_USERS); if version_check_string.starts_with(UUTILS_WARNING) { println!("{}\ntest skipped", version_check_string); return; } - // Same typical users that GNU testsuite is using. + // Same typical users that GNU test suite is using. let test_users = ["root", "man", "postfix", "sshd", &whoami()]; let scene = TestScenario::new(util_name!()); @@ -278,7 +278,7 @@ fn test_id_multiple_users_non_existing() { let util_name = util_name!(); #[cfg(all(unix, not(target_os = "linux")))] let util_name = &format!("g{}", util_name!()); - let version_check_string = check_coreutil_version(util_name, VERSION_MULTIPLE_USERS); + let version_check_string = check_coreutil_version(util_name, VERSION_MIN_MULTIPLE_USERS); if version_check_string.starts_with(UUTILS_WARNING) { println!("{}\ntest skipped", version_check_string); return; @@ -467,7 +467,7 @@ fn expected_result(args: &[&str]) -> Result { #[cfg(all(unix, not(target_os = "linux")))] let util_name = &format!("g{}", util_name!()); - let version_check_string = check_coreutil_version(util_name, VERSION_EXPECTED); + let version_check_string = check_coreutil_version(util_name, VERSION_MIN); if version_check_string.starts_with(UUTILS_WARNING) { return Err(version_check_string); }