Initial Course

This commit is contained in:
David Gil de Gómez Pérez
2026-08-11 17:40:36 +03:00
commit 9aed1d1d86
202 changed files with 3420 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
#include "ranges_zip.hpp"
#include <gtest/gtest.h>
TEST(RangesZip, ZipSum) {
EXPECT_EQ(cpp23::zip_sum({1, 2, 3}, {4, 5, 6}), (std::vector<int>{5, 7, 9}));
}
TEST(RangesZip, ChunkStrings) {
EXPECT_EQ(cpp23::chunk_strings({"a", "b", "c", "d"}, 2),
(std::vector<std::vector<std::string>>{{"a", "b"}, {"c", "d"}}));
}
TEST(RangesZip, AdjacentDifferences) {
EXPECT_EQ(cpp23::adjacent_differences({1, 4, 9, 16}), (std::vector<int>{3, 5, 7}));
}