mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
add test: some algorithms
This commit is contained in:
parent
e2b207d3be
commit
830fc27394
8 changed files with 176 additions and 12 deletions
|
@ -29,6 +29,44 @@ namespace testspr {
|
|||
);
|
||||
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
|
||||
}
|
||||
|
||||
{
|
||||
SPROUT_STATIC_CONSTEXPR auto found = sprout::lower_bound(
|
||||
testspr::reduct_forward(sprout::begin(arr1)),
|
||||
testspr::reduct_forward(sprout::end(arr1)),
|
||||
7
|
||||
).base();
|
||||
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 6);
|
||||
}
|
||||
{
|
||||
SPROUT_STATIC_CONSTEXPR auto found = sprout::lower_bound(
|
||||
testspr::reduct_forward(sprout::begin(arr1)),
|
||||
testspr::reduct_forward(sprout::begin(arr1) + 5),
|
||||
7,
|
||||
testspr::less<int>()
|
||||
).base();
|
||||
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
|
||||
}
|
||||
|
||||
#if defined(__clang__)
|
||||
{
|
||||
SPROUT_STATIC_CONSTEXPR auto found = sprout::lower_bound(
|
||||
testspr::reduct_random_access(sprout::begin(arr1)),
|
||||
testspr::reduct_random_access(sprout::end(arr1)),
|
||||
7
|
||||
).base();
|
||||
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 6);
|
||||
}
|
||||
{
|
||||
SPROUT_STATIC_CONSTEXPR auto found = sprout::lower_bound(
|
||||
testspr::reduct_random_access(sprout::begin(arr1)),
|
||||
testspr::reduct_random_access(sprout::begin(arr1) + 5),
|
||||
7,
|
||||
testspr::less<int>()
|
||||
).base();
|
||||
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} // namespace testspr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue