mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Rename List.find and findIndex to include 'First'
This commit is contained in:
parent
661376958c
commit
f3b8025d8d
4 changed files with 17 additions and 17 deletions
|
@ -2846,7 +2846,7 @@ fn list_find() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.find ["a", "bc", "def"] (\s -> Str.countGraphemes s > 1) is
|
||||
when List.findFirst ["a", "bc", "def"] (\s -> Str.countGraphemes s > 1) is
|
||||
Ok v -> v
|
||||
Err _ -> "not found"
|
||||
"#
|
||||
|
@ -2862,7 +2862,7 @@ fn list_find_not_found() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.find ["a", "bc", "def"] (\s -> Str.countGraphemes s > 5) is
|
||||
when List.findFirst ["a", "bc", "def"] (\s -> Str.countGraphemes s > 5) is
|
||||
Ok v -> v
|
||||
Err _ -> "not found"
|
||||
"#
|
||||
|
@ -2878,7 +2878,7 @@ fn list_find_empty_typed_list() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.find [] (\s -> Str.countGraphemes s > 5) is
|
||||
when List.findFirst [] (\s -> Str.countGraphemes s > 5) is
|
||||
Ok v -> v
|
||||
Err _ -> "not found"
|
||||
"#
|
||||
|
@ -2895,7 +2895,7 @@ fn list_find_empty_layout() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
List.find [] (\_ -> True)
|
||||
List.findFirst [] (\_ -> True)
|
||||
"#
|
||||
),
|
||||
0,
|
||||
|
@ -2909,7 +2909,7 @@ fn list_find_index() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.findIndex ["a", "bc", "def"] (\s -> Str.countGraphemes s > 1) is
|
||||
when List.findFirstIndex ["a", "bc", "def"] (\s -> Str.countGraphemes s > 1) is
|
||||
Ok v -> v
|
||||
Err _ -> 999
|
||||
"#
|
||||
|
@ -2925,7 +2925,7 @@ fn list_find_index_not_found() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.findIndex ["a", "bc", "def"] (\s -> Str.countGraphemes s > 5) is
|
||||
when List.findFirstIndex ["a", "bc", "def"] (\s -> Str.countGraphemes s > 5) is
|
||||
Ok v -> v
|
||||
Err _ -> 999
|
||||
"#
|
||||
|
@ -2941,7 +2941,7 @@ fn list_find_index_empty_typed_list() {
|
|||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.findIndex [] (\s -> Str.countGraphemes s > 5) is
|
||||
when List.findFirstIndex [] (\s -> Str.countGraphemes s > 5) is
|
||||
Ok v -> v
|
||||
Err _ -> 999
|
||||
"#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue