1 #include "clangmm.hpp"
2 #include <cassert>
3 #include <string>
4 
main()5 int main() {
6   std::string tests_path = LIBCLANGMM_TESTS_PATH;
7   std::string path(tests_path + "/case/main.cpp");
8 
9   auto index = std::make_shared<clangmm::Index>(0, 0);
10 
11   clangmm::TranslationUnit tu(index, path, {});
12 
13   auto tokens = tu.get_tokens(0, 113);
14 
15   assert(tokens->size() == 32);
16   assert((*tokens)[1].get_kind() == clangmm::Token::Kind::Identifier);
17 
18   std::string str = (*tokens)[28].get_spelling();
19   assert(str == "return");
20 }
21