Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : */
9 :
10 : #include <sal/types.h>
11 : #include <cppunit/TestFixture.h>
12 : #include <cppunit/extensions/HelperMacros.h>
13 : #include "rtl/ustring.hxx"
14 :
15 : namespace test { namespace oustring {
16 :
17 6 : class StartsWith: public CppUnit::TestFixture
18 : {
19 : private:
20 : void startsWith();
21 :
22 4 : CPPUNIT_TEST_SUITE(StartsWith);
23 2 : CPPUNIT_TEST(startsWith);
24 4 : CPPUNIT_TEST_SUITE_END();
25 : };
26 :
27 : } }
28 :
29 2 : CPPUNIT_TEST_SUITE_REGISTRATION(test::oustring::StartsWith);
30 :
31 2 : void test::oustring::StartsWith::startsWith()
32 : {
33 2 : CPPUNIT_ASSERT( rtl::OUString( "foobar" ).startsWith( "foo" ));
34 2 : CPPUNIT_ASSERT( !rtl::OUString( "foo" ).startsWith( "foobar" ));
35 2 : CPPUNIT_ASSERT( !rtl::OUString( "foobar" ).startsWith( "oo" ));
36 8 : }
37 :
38 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|