diff options
author | Elliott Hughes <enh@google.com> | 2019-11-04 20:57:59 -0800 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-11-05 19:19:31 -0600 |
commit | e1ea687636435f9b8e2725671b96740fedf5347a (patch) | |
tree | 08aeff445de782b0f7f30088d7a8ebc2e00d5dc5 /tests | |
parent | 13468ca834b3ae6203541b44e1e2b2d7d86bb153 (diff) | |
download | toybox-e1ea687636435f9b8e2725671b96740fedf5347a.tar.gz |
id.c: fix -nG.
The previous patch broke -nG, so move the -G code back to showone()
which handles -n.
Add the missing tests for the various uses of -n.
Also refactor the code to avoid the need to test optflags directly.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/id.test | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/id.test b/tests/id.test index f62938f0..05c5378c 100755 --- a/tests/id.test +++ b/tests/id.test @@ -7,7 +7,10 @@ testing "id 0" "id 0" "uid=0(root) gid=0(root) groups=0(root)\n" "" "" testing "id root" "id root" "uid=0(root) gid=0(root) groups=0(root)\n" "" "" testing "id -G root" "id -G root" "0\n" "" "" +testing "id -nG root" "id -nG root" "root\n" "" "" testing "id -g root" "id -g root" "0\n" "" "" +testing "id -ng root" "id -ng root" "root\n" "" "" testing "id -u root" "id -u root" "0\n" "" "" +testing "id -nu root" "id -nu root" "root\n" "" "" testing "id no-such-user" "id no-such-user 2>/dev/null ; echo \$?" "1\n" "" "" testing "id 9999999" "id 9999999 2>/dev/null ; echo \$?" "1\n" "" "" |