mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-19 05:09:51 -07:00
feat: add test for new username_display config options
This commit is contained in:
parent
7f752da89d
commit
d2b06d16ee
1 changed files with 7 additions and 0 deletions
|
@ -1179,6 +1179,13 @@ mod tests {
|
|||
let res: Tunables =
|
||||
serde_json::from_str("{\"username_display\": \"displayname\"}").unwrap();
|
||||
assert_eq!(res.username_display, Some(UserDisplayStyle::DisplayName));
|
||||
|
||||
let res: Tunables = serde_json::from_str(
|
||||
"{\"username_display\": \"regex\",\n\"username_display_regex\": \"foo\"}",
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(res.username_display, Some(UserDisplayStyle::Regex));
|
||||
assert_eq!(res.username_display_regex.unwrap_or("FAILED".into()), "foo".to_string());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue