Merge remote-tracking branch 'remote/main' into builtin-task

This commit is contained in:
Luke Boswell 2024-07-29 16:05:51 +10:00
commit eca453d07f
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
367 changed files with 14084 additions and 12080 deletions

View file

@ -4664,3 +4664,67 @@ fn multiple_uses_of_bool_true_tag_union() {
bool
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
fn issue_6139_contains() {
assert_evals_to!(
indoc!(
r#"
buggy = \node, seen ->
if List.contains seen node then
seen
else
# node = "B"
nextNode = stepNode node
# node = "C"
buggy nextNode (List.append seen node)
stepNode = \node ->
when node is
"A" -> "B"
"B" -> "C"
"C" -> "D"
"D" -> "A"
_ -> crash ""
buggy "A" []
"#
),
RocList::from_slice(&[
RocStr::from("A"),
RocStr::from("B"),
RocStr::from("C"),
RocStr::from("D"),
]),
RocList<RocStr>
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
fn issue_6139_prefixes() {
assert_evals_to!(
indoc!(
r#"
prefixes = \str, soFar ->
if Str.isEmpty str then
soFar
else
graphemes =
Str.toUtf8 str
|> List.map \c -> Str.fromUtf8 [c] |> Result.withDefault ""
remaining = List.dropFirst graphemes 1
next = Str.joinWith remaining ""
prefixes next (List.append soFar str)
prefixes "abc" []
"#
),
RocList::from_slice(&[RocStr::from("abc"), RocStr::from("bc"), RocStr::from("c")]),
RocList<RocStr>
);
}

View file

@ -2176,8 +2176,8 @@ fn refcount_nullable_unwrapped_needing_no_refcount_issue_5027() {
await : Effect, (Str -> Effect) -> Effect
await = \fx, cont ->
after
fx
cont
fx
cont
succeed : {} -> Effect
succeed = \{} -> (\{} -> "success")