]> git.localhorst.tv Git - blank.git/blob - tst/io/TokenTest.hpp
test for Tokenizer
[blank.git] / tst / io / TokenTest.hpp
1 #ifndef BLANK_TEST_IO_TOKENTEST_HPP
2 #define BLANK_TEST_IO_TOKENTEST_HPP
3
4 #include "io/Token.hpp"
5 #include "io/Tokenizer.hpp"
6
7 #include <string>
8 #include <cppunit/extensions/HelperMacros.h>
9
10
11 namespace blank {
12
13 namespace test {
14
15 class TokenTest
16 : public CppUnit::TestFixture {
17
18 CPPUNIT_TEST_SUITE(TokenTest);
19
20 CPPUNIT_TEST(testTypeIO);
21 CPPUNIT_TEST(testTokenIO);
22 CPPUNIT_TEST(testTokenizer);
23 CPPUNIT_TEST(testTokenizerBrokenComment);
24
25 CPPUNIT_TEST_SUITE_END();
26
27 public:
28         void setUp();
29         void tearDown();
30
31         void testTypeIO();
32         void testTokenIO();
33         void testTokenizer();
34         void testTokenizerBrokenComment();
35
36         static void AssertStreamOutput(
37                 Token::Type, std::string expected);
38         static void AssertStreamOutput(
39                 const Token &, std::string expected);
40
41         static void AssertHasMore(Tokenizer &);
42         static void AssertToken(
43                 Token::Type expected_type, const Token &actual_token);
44         static void AssertToken(
45                 Token::Type expected_type, std::string expected_value,
46                 const Token &actual_token);
47
48 };
49
50 }
51 }
52
53 #endif