Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f49ebcba99
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (30 sloc) 0.784 kb
#include "dict.h"
#include "fdict.h"
#include <iostream>
#define BOOST_TEST_MODULE CrpTest
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <cassert>
using namespace std;
BOOST_AUTO_TEST_CASE(Convert) {
Dict d;
WordID a = d.Convert("foo");
WordID b = d.Convert("bar");
std::string x = "foo";
WordID c = d.Convert(x);
assert(a != b);
BOOST_CHECK_EQUAL(a, c);
BOOST_CHECK_EQUAL(d.Convert(a), "foo");
BOOST_CHECK_EQUAL(d.Convert(b), "bar");
}
BOOST_AUTO_TEST_CASE(FDictTest) {
int fid = FD::Convert("First");
assert(fid > 0);
BOOST_CHECK_EQUAL(FD::Convert(fid), "First");
string x = FD::Escape("=");
cerr << x << endl;
assert(x != "=");
x = FD::Escape(";");
cerr << x << endl;
assert(x != ";");
}
Jump to Line
Something went wrong with that request. Please try again.