summaryrefslogtreecommitdiff
path: root/test/MimeTypeTest.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-06-10 22:24:13 +0200
committerMax Kellermann <max@duempel.org>2016-06-10 22:24:13 +0200
commit92cdea123e9ad168c7fb9d9ec869a7512f1dca91 (patch)
tree45049939b8266972b875644654095bc8c1107e17 /test/MimeTypeTest.hxx
parente4c7e343c81fe1a847dc90cf20e9cd249ed4e353 (diff)
TagStream, decoder/Thread, ...: ignore MIME type parameters for matching plugins
Diffstat (limited to 'test/MimeTypeTest.hxx')
-rw-r--r--test/MimeTypeTest.hxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/MimeTypeTest.hxx b/test/MimeTypeTest.hxx
new file mode 100644
index 000000000..0e243e6ba
--- /dev/null
+++ b/test/MimeTypeTest.hxx
@@ -0,0 +1,28 @@
+/*
+ * Unit tests for src/util/
+ */
+
+#include "check.h"
+#include "util/MimeType.hxx"
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <string.h>
+
+class MimeTypeTest : public CppUnit::TestFixture {
+ CPPUNIT_TEST_SUITE(MimeTypeTest);
+ CPPUNIT_TEST(TestBase);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void TestBase() {
+ CPPUNIT_ASSERT("" == GetMimeTypeBase(""));
+ CPPUNIT_ASSERT("" == GetMimeTypeBase(";"));
+ CPPUNIT_ASSERT("foo" == GetMimeTypeBase("foo"));
+ CPPUNIT_ASSERT("foo/bar" == GetMimeTypeBase("foo/bar"));
+ CPPUNIT_ASSERT("foo/bar" == GetMimeTypeBase("foo/bar;"));
+ CPPUNIT_ASSERT("foo/bar" == GetMimeTypeBase("foo/bar; x=y"));
+ CPPUNIT_ASSERT("foo/bar" == GetMimeTypeBase("foo/bar;x=y"));
+ }
+};