Fix typo in uppercase filter (#4810)

This commit is contained in:
Dave MacLeod 2024-09-18 20:53:48 +09:00 committed by GitHub
parent 2269692fb3
commit 5867ce95d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -116,7 +116,7 @@ impl Filter {
#[inline] #[inline]
fn uppercase(c: &str) -> FilterResult { fn uppercase(c: &str) -> FilterResult {
Self::check_term(c, c.to_lowercase()) Self::check_term(c, c.to_uppercase())
} }
#[inline] #[inline]
@ -842,4 +842,32 @@ mod tests {
) )
.await; .await;
} }
#[tokio::test]
async fn test_uppercase_tokens() {
test_analyzer_tokens(
"ANALYZER test TOKENIZERS blank,class FILTERS uppercase",
"Ālea IactA!",
&[
Token::String {
chars: (0, 0, 4),
bytes: (0, 5),
term: "ĀLEA".to_string(),
len: 4,
},
Token::String {
chars: (5, 5, 10),
bytes: (6, 11),
term: "IACTA".to_string(),
len: 5,
},
Token::Ref {
chars: (10, 10, 11),
bytes: (11, 12),
len: 1,
},
],
)
.await;
}
} }