aboutsummaryrefslogtreecommitdiff
path: root/test/test_caseloading.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2021-01-29 12:17:54 -0600
committerGitHub <noreply@github.com>2021-01-29 12:17:54 -0600
commit097220f11afa9cb0a045ac21fdedad6e0df69f57 (patch)
treecd9ea0054cf3ec4e584ff650bce7e0a3967ce9e8 /test/test_caseloading.cpp
parent5cafb011f5b3cc2aef780f767e0bf054d18efc0f (diff)
parent9242c3dd0d6429ae79679c1f7a2846c228f6d3e8 (diff)
Merge pull request #368 from skyedeving/add-tests
Add a CMakeLists, tests, and pipeline to automatically test with Github actions
Diffstat (limited to 'test/test_caseloading.cpp')
-rw-r--r--test/test_caseloading.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_caseloading.cpp b/test/test_caseloading.cpp
new file mode 100644
index 0000000..5df2782
--- /dev/null
+++ b/test/test_caseloading.cpp
@@ -0,0 +1,18 @@
+#include <catch2/catch.hpp>
+
+#include <QStringList>
+
+TEST_CASE("Sort case evidence numerically", "[case]") {
+ // Parameters
+ QStringList case_evidence = {"1", "10", "11", "2", "3", "4", "5", "6", "7", "8", "9"};
+ QStringList case_evidence_sorted = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"};
+
+ // Sort
+ std::sort(case_evidence.begin(), case_evidence.end(),
+ [] (const QString &a, const QString &b) {
+ return a.toInt() < b.toInt();
+ });
+
+ // Test
+ REQUIRE(case_evidence == case_evidence_sorted);
+}