summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/test/TestHTMLUtil.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
committermanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
commitbe933ef2241d79558f91796cc5b3a161f72ebf9c (patch)
treefe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/utils/test/TestHTMLUtil.cpp
parent5f8335c1e49ce108ef3481863833c98efa00411b (diff)
downloadkodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip
sync with upstream
Diffstat (limited to 'xbmc/utils/test/TestHTMLUtil.cpp')
-rw-r--r--xbmc/utils/test/TestHTMLUtil.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/xbmc/utils/test/TestHTMLUtil.cpp b/xbmc/utils/test/TestHTMLUtil.cpp
new file mode 100644
index 0000000..7d0e515
--- /dev/null
+++ b/xbmc/utils/test/TestHTMLUtil.cpp
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#include "utils/HTMLUtil.h"
10
11#include <gtest/gtest.h>
12
13TEST(TestHTMLUtil, RemoveTags)
14{
15 std::string str;
16 str = "<!DOCTYPE html>\n"
17 "<html>\n"
18 " <head class=\"someclass\">\n"
19 " <body>\n"
20 " <p>blah blah blah</p>\n"
21 " </body>\n"
22 " </head>\n"
23 "</html>\n";
24 HTML::CHTMLUtil::RemoveTags(str);
25 EXPECT_STREQ("\n\n \n \n blah blah blah\n \n \n\n",
26 str.c_str());
27}
28
29TEST(TestHTMLUtil, ConvertHTMLToW)
30{
31 std::wstring inw, refstrw, varstrw;
32 inw = L"&aring;&amp;&euro;";
33 refstrw = L"\u00e5&\u20ac";
34 HTML::CHTMLUtil::ConvertHTMLToW(inw, varstrw);
35 EXPECT_STREQ(refstrw.c_str(), varstrw.c_str());
36}