summaryrefslogtreecommitdiff
path: root/test/collator_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-17 17:20:57 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-17 17:20:57 +0100
commit6e09a576c0f1e36d442c40e1d3ddb6c29df8b7ea (patch)
treee14913a0e4d978548189e81af4f4302c2b2ec92d /test/collator_test.cc
parent8459b5cfb0c8adeef176a34e5b301bc18471a80b (diff)
Add some very basic tests of Collator.
Diffstat (limited to 'test/collator_test.cc')
-rw-r--r--test/collator_test.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/collator_test.cc b/test/collator_test.cc
new file mode 100644
index 000000000..fadc5f063
--- /dev/null
+++ b/test/collator_test.cc
@@ -0,0 +1,32 @@
+/*
+ Copyright (C) 2023 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include "lib/collator.h"
+#include <boost/test/unit_test.hpp>
+
+
+BOOST_AUTO_TEST_CASE(collator_compare_works_and_ignores_case)
+{
+ Collator collator;
+
+ BOOST_CHECK_EQUAL(collator.compare("So often YOU won't even notice", "SO OFTEN you won't even NOTiCE"), 0);
+ BOOST_CHECK_EQUAL(collator.compare("So often YOU won't even notice", "SO OFTEN you won't even see"), -1);
+}