Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoorkin authored Mar 13, 2024
2 parents ff36deb + 51ecfd1 commit 97a9c35
Show file tree
Hide file tree
Showing 3 changed files with 735 additions and 24 deletions.
8 changes: 2 additions & 6 deletions list/list.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ test "iter" {
let mut i = 0
let mut failed = false
ls.iter(fn(x) { i = i + 1; if x != i { failed = true } })
if failed {
return Err("iter test failed")
}
@assertion.assert_false(failed)?
}

/// Iterates over the list with index.
Expand All @@ -91,9 +89,7 @@ test "iteri" {
let mut failed = false
let ls = from_array([1, 2, 3, 4, 5])
ls.iteri(fn(i, x) { if x != v + 1 || i != v { failed = true }; v = v + 1 })
if failed {
return Err("iteri test failed")
}
@assertion.assert_false(failed)?
}

/// Maps the list.
Expand Down
3 changes: 2 additions & 1 deletion vec/moon.pkg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"import": [
{ "path": "moonbitlang/core/assertion", "alias": "assertion" }
"moonbitlang/core/assertion",
"moonbitlang/core/string"
]
}
Loading

0 comments on commit 97a9c35

Please sign in to comment.