Skip to content
This repository was archived by the owner on Feb 23, 2019. It is now read-only.

Commit c716e0a

Browse files
committed
Fix Array.delete
1 parent 3bfc4d9 commit c716e0a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

source/Array.mint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ module Array {
261261
Array.delete("a", ["a", "b", "c"]) == ["b", "c"]
262262
*/
263263
fun delete (what : a, array : Array(a)) : Array(a) {
264-
reject((item : a) : Bool => { item != what }, array)
264+
reject((item : a) : Bool => { item == what }, array)
265265
}
266266

267267
/*

tests/Array.mint

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,3 +550,16 @@ suite "Array.groupsOf" {
550550
}
551551
}
552552
}
553+
554+
suite "Array.delete" {
555+
test "it removes the item" {
556+
Array.delete("a", [
557+
"a",
558+
"b",
559+
"c"
560+
]) == [
561+
"b",
562+
"c"
563+
]
564+
}
565+
}

0 commit comments

Comments
 (0)