| 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 <cppunit/TestFixture.h> |
| 11 |
#include <cppunit/extensions/HelperMacros.h> |
| 12 |
#include <rtl/ustring.hxx> |
| 13 |
|
| 14 |
namespace test::oustring { |
| 15 |
|
| 16 |
class StartsWith: public CppUnit::TestFixture |
| 17 |
{ |
| 18 |
private: |
| 19 |
void startsWith(); |
| 20 |
|
| 21 |
CPPUNIT_TEST_SUITE(StartsWith); |
| 22 |
CPPUNIT_TEST(startsWith); |
| 23 |
CPPUNIT_TEST_SUITE_END(); |
| 24 |
}; |
| 25 |
|
| 26 |
} |
| 27 |
|
| 28 |
CPPUNIT_TEST_SUITE_REGISTRATION(test::oustring::StartsWith); |
| 29 |
|
| 30 |
void test::oustring::StartsWith::startsWith() |
| 31 |
{ |
| 32 |
CPPUNIT_ASSERT( u"foobar"_ustr.startsWith( "foo" )); |
| 33 |
CPPUNIT_ASSERT( !u"foo"_ustr.startsWith( "foobar" )); |
| 34 |
CPPUNIT_ASSERT( !u"foobar"_ustr.startsWith( "oo" )); |
| 35 |
} |
| 36 |
|
| 37 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |