Add more test case to author name filter

This commit is contained in:
2022-06-22 05:13:37 +00:00
committed by GitHub
parent cd29362e27
commit 7c5c993c3e

View File

@@ -177,4 +177,14 @@ fn test_author_name_filter() {
)
.unwrap();
assert_eq!(l.filter("桃豆こまもち🍡日曜西ま11a"), "桃豆こまもち");
let l = AuthorNameFilter::from_json(
json::array![{"type": "regex", "rule": "(.*(?=桃豆こまもち))?((?<=桃豆こまもち).*)?"}],
)
.unwrap();
assert_eq!(l.filter("桃豆こまもち🍡日曜西ま11a"), "桃豆こまもち");
assert_eq!(
l.filter("Some_rubbish@桃豆こまもち🍡日曜西ま11a"),
"桃豆こまもち"
);
assert_eq!(l.filter("Some_rubbish@桃豆こまもち"), "桃豆こまもち");
}