Hydrogen/unit/scanner_test.cpp

17 lines
457 B
C++

#include "doctest.h"
#include "stdc++.h"
#include "Scanner.h"
#include "Tbs.h"
using std::string,std::vector;
TEST_CASE("Scanner_Test") {
Scanner scanner;
Tbs tb;
scanner.scan("to be or not to be is a problem.",tb);
unordered_map<int,string> test;
test[1] = "to",test[2] = "be",test[3] = "or",test[4] = "not",test[5] = "to",test[6] ="be",test[7] = "is",test[8] = "a";
CHECK(tb.ConstTable == test);
CHECK(tb.IdTable == test);
}