Add core graph member functions
This commit is contained in:
26
test/graph_test.cc
Normal file
26
test/graph_test.cc
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <doctest/doctest.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "include/graph.h"
|
||||
|
||||
TEST_SUITE("Testing Graph.") {
|
||||
using namespace graph;
|
||||
|
||||
TEST_CASE("Insert vertices/edges.") {
|
||||
Graph<std::uint16_t> G;
|
||||
|
||||
G.insert(1, 2);
|
||||
G.insert(1, 4);
|
||||
G.insert(1, 6);
|
||||
G.insert(2, 4);
|
||||
G.insert(2, 5);
|
||||
G.insert(3, 4);
|
||||
G.insert(3, 6);
|
||||
G.insert(4, 6);
|
||||
G.insert(5, 6);
|
||||
|
||||
// CHECK_EQ(G.connected(1, 5), true);
|
||||
|
||||
}
|
||||
}
|
||||
2
test/main.cc
Normal file
2
test/main.cc
Normal file
@@ -0,0 +1,2 @@
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
#include <doctest/doctest.h>
|
||||
Reference in New Issue
Block a user