/* ====================================================================
 * Copyright (c) 2003-2008, Martin Hauner
 *                          http://subcommander.tigris.org
 *
 * Subcommander is licensed as described in the file doc/COPYING, which
 * you should have received as part of this distribution.
 * ====================================================================
 */

#include "StringUtilTest.h"

// cppunit
#include <cppunit/TestSuite.h>
#include <cppunit/TestCaller.h>

// sc
#include "sublib/StringUtil.h"

// qt
#include <QtCore/QString>


void StringUtilTest::setUp()
{
}

void StringUtilTest::tearDown()
{
}

void StringUtilTest::testCompare()
{
  CPPUNIT_ASSERT(  sc::compare( "2", "10" )       < 0 );
  CPPUNIT_ASSERT(  sc::compare( "aaa2", "aaa10" ) < 0 );

  // crashes prior to r1385
  CPPUNIT_ASSERT(  sc::compare( "a-hallöle", "a-ö" ) < 0 );

  CPPUNIT_ASSERT(  sc::compare(
    "123456789012345678901",
    "123456789012345678902" ) == 0 );
}
