summaryrefslogtreecommitdiff
path: root/slicer/test/helpers.cpp
blob: 808e9d091698ad2397df829e39acdc334e76237a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "helpers.h"
#include <boost/test/test_tools.hpp>
#include <fstream>

void
diff(const std::filesystem::path & left, const std::filesystem::path & right)
{
	std::ifstream fl(left.string());
	std::ifstream fr(right.string());

	std::string l, r;
	std::copy_if(std::istreambuf_iterator<char>(fl), std::istreambuf_iterator<char>(), back_inserter(l), [](char x) {
		return !isspace(x);
	});
	std::copy_if(std::istreambuf_iterator<char>(fr), std::istreambuf_iterator<char>(), back_inserter(r), [](char x) {
		return !isspace(x);
	});

	BOOST_REQUIRE_EQUAL(l, r);
}