Merge branch 'main' into str-withprefix

This commit is contained in:
Prajwal S N 2022-10-09 15:53:16 +05:30
commit aef15ac1e8
No known key found for this signature in database
GPG key ID: D0FECEE245BC2695
57 changed files with 1388 additions and 631 deletions

View file

@ -1931,6 +1931,34 @@ fn when_on_strings() {
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn with_capacity() {
assert_evals_to!(
indoc!(
r#"
Str.withCapacity 10
"#
),
RocStr::from(""),
RocStr
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn with_capacity_concat() {
assert_evals_to!(
indoc!(
r#"
Str.withCapacity 10 |> Str.concat "Forty-two"
"#
),
RocStr::from("Forty-two"),
RocStr
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn str_with_prefix() {