You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
412 B
21 lines
412 B
2 years ago
|
use super::User;
|
||
|
|
||
|
fn test_user(name: &str, discriminator: u16) -> User {
|
||
|
User {
|
||
|
name: name.to_owned(),
|
||
|
discriminator,
|
||
|
..Default::default()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn test_legacy_username() {
|
||
|
let user = test_user("test", 123);
|
||
|
assert_eq!(user.username(), "test#0123");
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn test_new_username() {
|
||
|
let user = test_user("test", 0);
|
||
|
assert_eq!(user.username(), "test");
|
||
|
}
|