Merge pull request #7543 from HajagosNorbert/ascii

add with_ascii_uppercased and caseless_ascii_equals to Str
This commit is contained in:
Sam Mohr 2025-01-24 10:58:22 -08:00 committed by GitHub
commit cf1cfefadb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 1974 additions and 1674 deletions

View file

@ -2431,3 +2431,27 @@ fn with_ascii_lowercased_non_zero_refcount() {
RocStr
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
fn with_ascii_uppercased() {
assert_evals_to!(
r#"
Str.with_ascii_uppercased("café")
"#,
RocStr::from("CAFé"),
RocStr
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
fn caseless_ascii_equals() {
assert_evals_to!(
r#"
Str.caseless_ascii_equals("CAfé", "caFé")
"#,
true,
bool
);
}