File: DotIOTest.cpp

package info (click to toggle)
abyss 2.3.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,284 kB
  • sloc: cpp: 78,182; ansic: 6,512; makefile: 2,252; perl: 672; sh: 509; haskell: 412; python: 4
file content (27 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "Graph/GraphIO.h"
#include "Graph/DotIO.h"
#include "Graph/UndirectedGraph.h"
#include "Graph/Properties.h"
#include <gtest/gtest.h>
#include <string>
#include <sstream>

using namespace std;

TEST(DotIOTest, read_dot)
{
	string undirectedGraph =
		"graph {\n"
		"     \"a\";\n"
		"     \"b\";\n"
		"     \"a\" -- \"b\";\n"
		"}\n";

	stringstream ss;
	ss << undirectedGraph;
	ASSERT_TRUE(ss.good());

	UndirectedGraph<NoProperty, NoProperty> g;
	read_dot(ss, g, DisallowParallelEdges());
	ASSERT_TRUE(!ss.fail());
}