mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-31 17:17:26 +00:00
Merge remote-tracking branch 'remote/main' into builtin-task
This commit is contained in:
commit
eca453d07f
367 changed files with 14084 additions and 12080 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue