mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-19 21:29:52 -07:00
feat: add test for new username_display config options
This commit is contained in:
parent
18e6865b68
commit
cf4d92ee6a
1 changed files with 7 additions and 0 deletions
|
@ -1179,6 +1179,13 @@ mod tests {
|
||||||
let res: Tunables =
|
let res: Tunables =
|
||||||
serde_json::from_str("{\"username_display\": \"displayname\"}").unwrap();
|
serde_json::from_str("{\"username_display\": \"displayname\"}").unwrap();
|
||||||
assert_eq!(res.username_display, Some(UserDisplayStyle::DisplayName));
|
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]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue