Files

17 lines
613 B
C++
Raw Permalink Normal View History

2026-08-11 17:40:36 +03:00
#include "container_adapters.hpp"
#include <gtest/gtest.h>
TEST(ContainerAdapters, BalancedParentheses) {
EXPECT_TRUE(stl_containers::is_balanced_parentheses("()[]{}"));
EXPECT_FALSE(stl_containers::is_balanced_parentheses("([)]"));
}
TEST(ContainerAdapters, SimulateQueue) {
EXPECT_EQ(stl_containers::simulate_queue({1, 2, 3}), (std::vector<int>{1, 2, 3}));
}
TEST(ContainerAdapters, TopKLargest) {
EXPECT_EQ(stl_containers::top_k_largest({3, 1, 4, 1, 5}, 3), (std::vector<int>{5, 4, 3}));
2026-08-16 09:02:44 +03:00
EXPECT_EQ(stl_containers::top_k_largest({3, 1, 4, 1, 5, 5, 5}, 3), (std::vector<int>{5, 4, 3}));
2026-08-11 17:40:36 +03:00
}