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

id: refactor identifiers

* change of identifier names and spelling according to the suggestions in the review of #2446
This commit is contained in:
Jan Scheer 2021-06-23 12:27:01 +02:00
parent 178399c20e
commit 4b3da59b0e
2 changed files with 11 additions and 11 deletions

View file

@ -26,7 +26,7 @@
// * Help text based on BSD's `id` manpage and GNU's `id` manpage. // * 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(non_camel_case_types)]
#![allow(dead_code)] #![allow(dead_code)]

View file

@ -1,6 +1,6 @@
use crate::common::util::*; 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. // 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, // 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 // 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. // 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_MIN: &str = "8.30"; // minimum Version for the reference `id` in $PATH
const VERSION_MULTIPLE_USERS: &str = "8.31"; 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_WARNING: &str = "uutils-tests-warning";
const UUTILS_INFO: &str = "uutils-tests-info"; const UUTILS_INFO: &str = "uutils-tests-info";
@ -210,7 +210,7 @@ fn test_id_multiple_users() {
let util_name = util_name!(); let util_name = util_name!();
#[cfg(all(unix, not(target_os = "linux")))] #[cfg(all(unix, not(target_os = "linux")))]
let util_name = &format!("g{}", util_name!()); 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) { if version_check_string.starts_with(UUTILS_WARNING) {
println!("{}\ntest skipped", version_check_string); println!("{}\ntest skipped", version_check_string);
return; return;
@ -278,7 +278,7 @@ fn test_id_multiple_users_non_existing() {
let util_name = util_name!(); let util_name = util_name!();
#[cfg(all(unix, not(target_os = "linux")))] #[cfg(all(unix, not(target_os = "linux")))]
let util_name = &format!("g{}", util_name!()); 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) { if version_check_string.starts_with(UUTILS_WARNING) {
println!("{}\ntest skipped", version_check_string); println!("{}\ntest skipped", version_check_string);
return; return;
@ -467,7 +467,7 @@ fn expected_result(args: &[&str]) -> Result<CmdResult, String> {
#[cfg(all(unix, not(target_os = "linux")))] #[cfg(all(unix, not(target_os = "linux")))]
let util_name = &format!("g{}", util_name!()); 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) { if version_check_string.starts_with(UUTILS_WARNING) {
return Err(version_check_string); return Err(version_check_string);
} }