1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #include "sal/config.h"
12 #include "cppunit/TestAssert.h"
13 #include "cppunit/TestFixture.h"
14 #include "cppunit/extensions/HelperMacros.h"
15 #include "cppunit/plugin/TestPlugIn.h"
16 #include "rtl/bootstrap.hxx"
17 #include "rtl/ustring.hxx"
21 class Test
: public CppUnit::TestFixture
{
23 virtual void setUp() SAL_OVERRIDE
;
26 CPPUNIT_TEST_SUITE(Test
);
27 CPPUNIT_TEST(testDollar
);
28 CPPUNIT_TEST(testIndirectDollar
);
29 CPPUNIT_TEST_SUITE_END();
33 void testIndirectDollar();
37 rtl::Bootstrap::set("TEST", "<expanded TEST>");
38 rtl::Bootstrap::set("WITH_DOLLAR", "foo\\$TEST");
39 rtl::Bootstrap::set("INDIRECT", "$WITH_DOLLAR");
42 void Test::testDollar() {
43 rtl::OUString
s("$WITH_DOLLAR");
44 rtl::Bootstrap::expandMacros(s
);
45 CPPUNIT_ASSERT_EQUAL(rtl::OUString("foo$TEST"), s
);
48 void Test::testIndirectDollar() {
49 rtl::OUString
s("$INDIRECT");
50 rtl::Bootstrap::expandMacros(s
);
51 CPPUNIT_ASSERT_EQUAL(rtl::OUString("foo$TEST"), s
);
54 CPPUNIT_TEST_SUITE_REGISTRATION(Test
);
58 CPPUNIT_PLUGIN_IMPLEMENT();
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */