2015-06-18 13:34:54 -04:00
|
|
|
|
2015-06-19 15:54:18 -04:00
|
|
|
#include "catch.hpp"
|
2015-06-18 13:34:54 -04:00
|
|
|
#include "../src/settings/LangConfig.h"
|
2015-06-19 15:54:18 -04:00
|
|
|
|
|
|
|
TEST_CASE("Language Config Library")
|
2015-06-18 13:34:54 -04:00
|
|
|
{
|
2015-06-19 15:54:18 -04:00
|
|
|
LangConfig *config = new LangConfig();
|
2015-06-18 13:34:54 -04:00
|
|
|
|
2015-06-19 15:54:18 -04:00
|
|
|
SECTION("GetLangList()")
|
2015-06-18 13:34:54 -04:00
|
|
|
{
|
2015-06-19 15:54:18 -04:00
|
|
|
StringMap list = config->GetLangList();
|
|
|
|
REQUIRE(list.size() > 0);
|
2015-06-18 13:34:54 -04:00
|
|
|
}
|
2015-06-19 15:54:18 -04:00
|
|
|
|
|
|
|
SECTION("GetLang()")
|
2015-06-18 13:34:54 -04:00
|
|
|
{
|
2015-06-19 15:54:18 -04:00
|
|
|
string lang = config->GetLang();
|
|
|
|
REQUIRE(lang == "");
|
2015-06-18 13:34:54 -04:00
|
|
|
}
|
|
|
|
|
2015-06-19 15:54:18 -04:00
|
|
|
SECTION("SetLang()")
|
|
|
|
{
|
|
|
|
string lang="cpp";
|
|
|
|
config->SetLang(lang);
|
|
|
|
REQUIRE(lang == config->GetLang());
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTION("GetLangByFile()")
|
|
|
|
{
|
|
|
|
wxFileName file("foo.cpp");
|
|
|
|
|
|
|
|
string lang = config->GetLangByFile(file);
|
|
|
|
REQUIRE("cpp" == lang);
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTION("GetLangByName()")
|
|
|
|
{
|
|
|
|
string lang = config->GetLangByName("C / C++");
|
|
|
|
REQUIRE("cpp" == lang);
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTION("GetCurrentLangName()")
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2015-06-18 13:34:54 -04:00
|
|
|
|
2015-06-19 15:54:18 -04:00
|
|
|
SECTION("GetLexerMap()")
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTION("GetKeywordList()")
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2015-06-18 13:34:54 -04:00
|
|
|
}
|