aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorYour Name <you@example.com>2022-02-22 12:54:38 -0500
committerYour Name <you@example.com>2022-02-22 12:54:38 -0500
commit0054b0d1dcf1a2d2950cc297b9c595a793827f7a (patch)
tree0c743bcdc1e3fce50b0ca106adf6753cfabe831a /src/test
parent2224cc3a999db3e582cfc140ec176818d3a50c68 (diff)
downloadlibbible-0054b0d1dcf1a2d2950cc297b9c595a793827f7a.tar.gz
libbible-0054b0d1dcf1a2d2950cc297b9c595a793827f7a.tar.bz2
libbible-0054b0d1dcf1a2d2950cc297b9c595a793827f7a.zip
Added a unit test for language name mapping
Diffstat (limited to 'src/test')
-rw-r--r--src/test/testLibbible.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/testLibbible.cc b/src/test/testLibbible.cc
index d3a265a..0f65e6d 100644
--- a/src/test/testLibbible.cc
+++ b/src/test/testLibbible.cc
@@ -29,6 +29,7 @@ class TestLibbible : public CppUnit::TestFixture
CPPUNIT_TEST(testGetPassages);
CPPUNIT_TEST(testGetText);
CPPUNIT_TEST(testSettings);
+ CPPUNIT_TEST(testLanguageNames);
CPPUNIT_TEST(testDownload);
CPPUNIT_TEST_SUITE_END();
@@ -41,6 +42,7 @@ class TestLibbible : public CppUnit::TestFixture
void testGetPassages(void);
void testGetText(void);
void testSettings(void);
+ void testLanguageNames(void);
void testDownload(void);
};
@@ -202,6 +204,13 @@ void TestLibbible::testSettings(void) {
CPPUNIT_ASSERT(libbible::settingsRead("test") == "");
}
+void TestLibbible::testLanguageNames(void) {
+ std::map<std::string, std::string> langs = libbible::getLanguageNames();
+ CPPUNIT_ASSERT(langs["en"] == "English");
+ CPPUNIT_ASSERT(langs["es"] == "Spanish");
+ CPPUNIT_ASSERT(langs["fr"] == "French");
+}
+
void TestLibbible::testDownload(void) {
map<string, vector<string>> modsAvailable = libbible::downloadModsAvailable();
// We try installing the first available one