Bump version to 6.4-15
[LibreOffice.git] / sal / qa / rtl / bootstrap / expand.cxx
blobe9799c15f37c66262a4db20d52acb424f4205c79
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/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>
19 namespace {
21 class Test: public CppUnit::TestFixture {
22 public:
23 virtual void setUp() override;
25 private:
26 CPPUNIT_TEST_SUITE(Test);
27 CPPUNIT_TEST(testDollar);
28 CPPUNIT_TEST(testIndirectDollar);
29 CPPUNIT_TEST_SUITE_END();
31 void testDollar();
33 void testIndirectDollar();
36 void Test::setUp() {
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 OUString s("$WITH_DOLLAR");
44 rtl::Bootstrap::expandMacros(s);
45 CPPUNIT_ASSERT_EQUAL(OUString("foo$TEST"), s);
48 void Test::testIndirectDollar() {
49 OUString s("$INDIRECT");
50 rtl::Bootstrap::expandMacros(s);
51 CPPUNIT_ASSERT_EQUAL(OUString("foo$TEST"), s);
54 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */