summaryrefslogtreecommitdiff
path: root/libs/pbd/test/natsort_test.cc
blob: 6e8d19b25499616b3f92a8daea10e051688fffa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "natsort_test.h"
#include "pbd/natsort.h"

CPPUNIT_TEST_SUITE_REGISTRATION (NatSortTest);

using namespace std;


void
NatSortTest::testBasic ()
{
	CPPUNIT_ASSERT (!PBD::naturally_less ("a32", "a4"));
	CPPUNIT_ASSERT (!PBD::naturally_less ("a32", "a04"));
	CPPUNIT_ASSERT ( PBD::naturally_less ("a32", "a40"));
	CPPUNIT_ASSERT ( PBD::naturally_less ("a32a", "a32b"));
	CPPUNIT_ASSERT (!PBD::naturally_less ("a32b", "a32a"));
	CPPUNIT_ASSERT (!PBD::naturally_less ("abcd", "abc"));
	CPPUNIT_ASSERT ( PBD::naturally_less ("abc", "abcd"));
	CPPUNIT_ASSERT (!PBD::naturally_less ("abc", "abc"));
}