mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Add Str.repeat test for big strings
This commit is contained in:
parent
b32a42f05a
commit
0cdafa1623
1 changed files with 11 additions and 10 deletions
|
@ -951,7 +951,7 @@ fn str_from_utf8_range_count_too_high_for_start() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn str_repeat() {
|
fn str_repeat_small() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
indoc!(r#"Str.repeat "Roc" 3"#),
|
indoc!(r#"Str.repeat "Roc" 3"#),
|
||||||
RocStr::from("RocRocRoc"),
|
RocStr::from("RocRocRoc"),
|
||||||
|
@ -960,19 +960,20 @@ fn str_repeat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn str_repeat_empty_string() {
|
fn str_repeat_big() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
indoc!(r#"Str.repeat "" 3"#),
|
indoc!(r#"Str.repeat "more than 16 characters" 2"#),
|
||||||
RocStr::from(""),
|
RocStr::from("more than 16 charactersmore than 16 characters"),
|
||||||
RocStr
|
RocStr
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn str_repeat_zero_times() {
|
fn str_repeat_empty_string() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(indoc!(r#"Str.repeat "" 3"#), RocStr::from(""), RocStr);
|
||||||
indoc!(r#"Str.repeat "Roc" 0"#),
|
}
|
||||||
RocStr::from(""),
|
|
||||||
RocStr
|
#[test]
|
||||||
);
|
fn str_repeat_zero_times() {
|
||||||
|
assert_evals_to!(indoc!(r#"Str.repeat "Roc" 0"#), RocStr::from(""), RocStr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue