diff options
author | Max Kellermann <max@duempel.org> | 2016-06-10 22:24:13 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-06-10 22:24:13 +0200 |
commit | 92cdea123e9ad168c7fb9d9ec869a7512f1dca91 (patch) | |
tree | 45049939b8266972b875644654095bc8c1107e17 /test/MimeTypeTest.hxx | |
parent | e4c7e343c81fe1a847dc90cf20e9cd249ed4e353 (diff) |
TagStream, decoder/Thread, ...: ignore MIME type parameters for matching plugins
Diffstat (limited to 'test/MimeTypeTest.hxx')
-rw-r--r-- | test/MimeTypeTest.hxx | 28 |
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")); + } +}; |