blob: b3a8234d6a39240c0d7de39c699b4693ff757d41 [file] [log] [blame]
Ashlesh Gawandeeb582eb2014-05-01 14:25:20 -05001/**
2 * Copyright (C) 2014 Regents of the University of Memphis.
3 * See COPYING for copyright and distribution information.
4 */
5
6#include "utility/tokenizer.hpp"
7#include <boost/test/unit_test.hpp>
8
9namespace nlsr {
10
11namespace test {
12
13BOOST_AUTO_TEST_SUITE(TestTokenizer)
14
15BOOST_AUTO_TEST_CASE(TokenizerBasic)
16{
17 Tokenizer token1("/ndn/memphis.edu/cs", "/");
18 Tokenizer token2("/ndn/memphis.edu/cs", "/");
19
20 Tokenizer token3("/test/hello");
21
22 BOOST_CHECK(token1.getFirstToken() == token2.getFirstToken());
23
24 BOOST_CHECK_EQUAL(token1.getRestOfLine(), token2.getRestOfLine());
25
26 BOOST_CHECK(token1.getFirstToken() != token3.getFirstToken());
27
28 BOOST_CHECK(token1.getRestOfLine() != token3.getRestOfLine());
29}
30
31BOOST_AUTO_TEST_SUITE_END()
32
33} //namespace test
34} //namespace nlsr