summaryrefslogtreecommitdiff
path: root/libs/pbd/test/natsort_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/test/natsort_test.cc')
-rw-r--r--libs/pbd/test/natsort_test.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/pbd/test/natsort_test.cc b/libs/pbd/test/natsort_test.cc
new file mode 100644
index 0000000000..6e8d19b254
--- /dev/null
+++ b/libs/pbd/test/natsort_test.cc
@@ -0,0 +1,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"));
+}