diff options
author | Varriount <Varriount@users.noreply.github.com> | 2014-03-27 15:08:19 -0400 |
---|---|---|
committer | Varriount <Varriount@users.noreply.github.com> | 2014-03-27 15:08:19 -0400 |
commit | f40625f5c4634a426fa4e181abf54e0ffbe52d88 (patch) | |
tree | 7dafbaf23562b74203d439448a4ea133ad87e174 /tests/stdlib/talgorithm.nim | |
parent | 74af96dbf6b74627659f2f9a04152eaa10f7a17d (diff) | |
parent | 491291ae24fe5901f4be918cbce2d6c21a0ae0e9 (diff) | |
download | Nim-f40625f5c4634a426fa4e181abf54e0ffbe52d88.tar.gz |
Merge pull request #1032 from barcharcraz/lowerBound
Added lowerBound function to the stdlib
Diffstat (limited to 'tests/stdlib/talgorithm.nim')
-rw-r--r-- | tests/stdlib/talgorithm.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/stdlib/talgorithm.nim b/tests/stdlib/talgorithm.nim index 7ab652c82..3ca425fbc 100644 --- a/tests/stdlib/talgorithm.nim +++ b/tests/stdlib/talgorithm.nim @@ -6,3 +6,6 @@ doAssert product(@[@[1,2]]) == @[@[1,2]], "a simple case of one element" doAssert product(@[@[1,2], @[3,4]]) == @[@[2,4],@[1,4],@[2,3],@[1,3]], "two elements" doAssert product(@[@[1,2], @[3,4], @[5,6]]) == @[@[2,4,6],@[1,4,6],@[2,3,6],@[1,3,6], @[2,4,5],@[1,4,5],@[2,3,5],@[1,3,5]], "three elements" doAssert product(@[@[1,2], @[]]) == newSeq[seq[int]](), "two elements, but one empty" +doAssert lowerBound([1,2,4], 3, system.cmp[int]) == 2 +doAssert lowerBound([1,2,2,3], 4, system.cmp[int]) == 4 +doAssert lowerBound([1,2,3,10], 11) == 4 \ No newline at end of file |