add with_ascii_uppercased and caseless_ascii_equals to Str

This commit is contained in:
Norbert Hajagos 2025-01-23 12:59:52 +01:00
parent 690e690bb7
commit fc0a9ec4cf
No known key found for this signature in database
49 changed files with 1974 additions and 1673 deletions

View file

@ -2244,3 +2244,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
);
}