add failing tests

* SIGSEGV for non-empty strings
This commit is contained in:
Dan Knutson 2021-10-23 10:16:30 -05:00
parent e7523ad41d
commit 46365da73a
3 changed files with 46 additions and 9 deletions

View file

@ -977,3 +977,31 @@ fn str_repeat_empty_string() {
fn str_repeat_zero_times() {
assert_evals_to!(indoc!(r#"Str.repeat "Roc" 0"#), RocStr::from(""), RocStr);
}
#[test]
fn str_trim_empty_string() {
assert_evals_to!(indoc!(r#"Str.trim """#), RocStr::from(""), RocStr);
}
#[test]
fn str_trim_blank_string() {
assert_evals_to!(indoc!(r#"Str.trim " ""#), RocStr::from(""), RocStr);
}
#[test]
fn str_trim_blank_string_large() {
assert_evals_to!(
indoc!(r#"Str.trim " " "#),
RocStr::from(""),
RocStr
);
}
#[test]
fn str_trim_hello_world() {
assert_evals_to!(
indoc!(r#"Str.trim " hello world ""#),
RocStr::from("hello world"),
RocStr
);
}