/// #include "Test/IndexTester.h" /// /// namespace clice::testing { /// /// namespace { /// /// TEST(Index, FunctionParams) { /// const char* code = R"cpp( /// void foo(int); /// /// void bar(int, int y = 2); /// )cpp"; /// /// IndexTester tester("main.cpp", code); /// tester.run(); /// /// /// auto data = tester.indices.find(tester.info->interested_file())->second.toJSON(); /// /// /// TODO: add more tests, FunctionTemplate, VarTemplate, ..., Dependent Name, ..., etc. /// /// add tests for find references ..., !test symbol count. /// } /// /// TEST(Index, FunctionType) { /// const char* code = R"cpp( /// template /// struct function; /// /// void bar(function& f); /// /// void bar2(function& f); /// )cpp"; /// /// IndexTester tester("main.cpp", code); /// tester.run(); /// /// /// auto data = tester.indices.find(tester.info->interested_file())->second.toJSON(); /// /// println("{}", data); /// /// tester.info->tu()->dump(); /// /// /// TODO: add more tests, FunctionTemplate, VarTemplate, ..., Dependent Name, ..., etc. /// /// add tests for find references ..., !test symbol count. /// } /// /// TEST(Index, Method) { /// const char* code = R"cpp( /// template /// struct function; /// /// template /// requires (__is_same(U, int)) /// struct function { /// void foo(); /// }; /// /// template /// requires (__is_same(U, float)) /// struct function { /// void foo(); /// }; /// )cpp"; /// /// IndexTester tester("main.cpp", code); /// tester.run(); /// /// /// auto data = tester.indices.find(tester.info->interested_file())->second.toJSON(); /// /// println("{}", data); /// /// tester.info->tu()->dump(); /// /// /// TODO: add more tests, FunctionTemplate, VarTemplate, ..., Dependent Name, ..., etc. /// /// add tests for find references ..., !test symbol count. /// } /// /// } // namespace /// /// } // namespace clice::testing