Skip to content

Commit

Permalink
Виничук Тимофей. (coverage patch) (#365)
Browse files Browse the repository at this point in the history
* Lab work #2

* paths changed

* Paths changed

* changes in vector intialization

* add const NOT_LISTED

* remove static

* int8_t

* NOT_LISTED

* fetch upstream

* remove Tim

* change const NOT_LISTED on int

* add new test
  • Loading branch information
V-inTim authored May 5, 2024
1 parent 0e5f6ab commit c5797d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/vinichuk_t_binary_search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set(LIBRARY "lib_${MODULE}")
set(TESTS "test_${MODULE}")
set(APPLICATION "app_${MODULE}")


# Include directory with public headers
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ TEST(BinarySearchTest, test_large_array) {
ASSERT_EQ(binsearch::binary_search(v, 784), 784);
}

TEST(BinarySearchTest, test_element_left_and_right) {
std::vector<int> v1{ 1, 4, 6, 59, 100, 344, 345 };
ASSERT_EQ(binsearch::binary_search(v1, 4), 1);
ASSERT_EQ(binsearch::binary_search(v1, 344), 5);
}

TEST(BinarySearchTest, test_first_element) {
std::vector<int> v1 { 1, 4, 6, 59, 345 };
std::vector<char> v2 { 'a', 'd', 'u', 'z'};
Expand Down

0 comments on commit c5797d6

Please sign in to comment.