Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sal / qa / rtl / strings / test_oustring_startswith.cxx
blob3a8a15a033777055945cac3e1b85c9f91e75f283
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <sal/types.h>
11 #include <cppunit/TestFixture.h>
12 #include <cppunit/extensions/HelperMacros.h>
13 #include <rtl/ustring.hxx>
15 namespace test { namespace oustring {
17 class StartsWith: public CppUnit::TestFixture
19 private:
20 void startsWith();
22 CPPUNIT_TEST_SUITE(StartsWith);
23 CPPUNIT_TEST(startsWith);
24 CPPUNIT_TEST_SUITE_END();
27 } }
29 CPPUNIT_TEST_SUITE_REGISTRATION(test::oustring::StartsWith);
31 void test::oustring::StartsWith::startsWith()
33 CPPUNIT_ASSERT( rtl::OUString( "foobar" ).startsWith( "foo" ));
34 CPPUNIT_ASSERT( !rtl::OUString( "foo" ).startsWith( "foobar" ));
35 CPPUNIT_ASSERT( !rtl::OUString( "foobar" ).startsWith( "oo" ));
38 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */