all: rename functions, deprecate old ones
Rename get_by_* to user_by_* and get_all to users. users() now can return errors.
This commit is contained in:
1 parent
326d93714a
commit
bdaaaaae58
3 files changed
+32
-8
No files matched your search
+6
-6
@@ -1,17 +1,17 @@
|
||||
// vtest build: !windows
|
||||
import pwd
|
||||
|
||||
fn test_get_by_uid() {
|
||||
pw := pwd.get_by_uid(0)!
|
||||
fn test_user_by_uid() {
|
||||
pw := pwd.user_by_uid(0)!
|
||||
assert pw.name == 'root'
|
||||
}
|
||||
|
||||
fn test_get_by_name() {
|
||||
pw := pwd.get_by_name('root')!
|
||||
fn test_user_by_name() {
|
||||
pw := pwd.user_by_name('root')!
|
||||
assert pw.uid == 0
|
||||
}
|
||||
|
||||
fn test_get_all() {
|
||||
pws := pwd.get_all()
|
||||
fn test_users() {
|
||||
pws := pwd.users()!
|
||||
assert pws.len > 0
|
||||
}
|
||||
Reference in new issue
Block a user