Rename List.find and findIndex to include 'First'

This commit is contained in:
Richard Feldman 2022-07-22 09:30:46 -04:00 committed by Folkert
parent 661376958c
commit f3b8025d8d
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 17 additions and 17 deletions

View file

@ -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
"#