-
-
Save jeffutter/ebe4f1c6efb94cf57eabffa5d2fd9e42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/Cellar/nim/1.0.0/nim/lib/pure/unittest.nim(631, 43) Error: type mismatch: got <array[0..-1, empty], int literal(1)> | |
but expected one of: | |
proc binarySearch[T, K](a: openArray[T]; key: K; | |
cmp: proc (x: T; y: K): int {.closure.}): int | |
first type mismatch at position: 3 | |
missing parameter: cmp | |
proc binarySearch[T](a: openArray[T]; key: T): int | |
first type mismatch at position: 2 | |
required type for key: T | |
but expression '1' is of type: int literal(1) | |
expression: binarySearch([], 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import algorithm | |
suite "Binary Search": | |
test "not found": | |
check binarySearch([], 1) == -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment