aboutsummaryrefslogtreecommitdiff
path: root/tests/load/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/load/driver.cxx')
-rw-r--r--tests/load/driver.cxx70
1 files changed, 44 insertions, 26 deletions
diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx
index 727f054..0f2c8de 100644
--- a/tests/load/driver.cxx
+++ b/tests/load/driver.cxx
@@ -3,7 +3,6 @@
#include <iostream>
#include <exception>
-#include <algorithm> // sort(), find()
#include <odb/session.hxx>
#include <odb/transaction.hxx>
@@ -39,7 +38,7 @@ check_location (shared_ptr<package>& p)
{
if (p->internal ())
return p->location && *p->location ==
- path (p->name.string () + "-" + p->version.string () + ".tar.gz");
+ path (p->name.string () + '-' + p->version.string () + ".tar.gz");
else
return !p->location;
}
@@ -58,7 +57,7 @@ check_external (const package& p)
!p.internal () &&
p.other_repositories.size () > 0 &&
p.priority == priority () &&
- p.changes.empty () &&
+ !p.changes &&
p.license_alternatives.empty () &&
p.dependencies.empty () &&
p.requirements.empty () &&
@@ -385,7 +384,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (fpvxy->other_repositories.empty ());
assert (fpvxy->priority == priority::low);
- assert (fpvxy->changes.empty ());
+ assert (!fpvxy->changes);
assert (fpvxy->license_alternatives.size () == 1);
assert (fpvxy->license_alternatives[0].size () == 1);
@@ -397,7 +396,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (check_location (fpvxy));
assert (fpvxy->sha256sum && *fpvxy->sha256sum ==
- "c994fd49f051ab7fb25f3a4e68ca878e484c5d3c2cb132b37d41224b0621b618");
+ "c25e5cae2f72664a3961c3ef88a82e67150c4bcc2a5e1fb4d250e621c5574187");
assert (fpvxy->buildable);
@@ -421,7 +420,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (fpv1->other_repositories[1].load () == cr);
assert (fpv1->priority == priority::low);
- assert (fpv1->changes.empty ());
+ assert (!fpv1->changes);
assert (fpv1->license_alternatives.size () == 1);
assert (fpv1->license_alternatives[0].size () == 1);
@@ -433,7 +432,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (check_location (fpv1));
assert (fpv1->sha256sum && *fpv1->sha256sum ==
- "e89c6d746f8b1ea3ec58d294946d2f683d133438d2ac8c88549ba24c19627e76");
+ "7382152bac5b4ce10215a5ecd6c94c490d0efc007031d3b03f407d068b74e624");
assert (fpv1->buildable);
@@ -455,7 +454,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (fpv2->internal_repository.load () == sr);
assert (fpv2->other_repositories.empty ());
assert (fpv2->priority == priority::low);
- assert (fpv2->changes.empty ());
+ assert (!fpv2->changes);
assert (fpv2->license_alternatives.size () == 1);
assert (fpv2->license_alternatives[0].size () == 1);
@@ -478,7 +477,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (check_location (fpv2));
assert (fpv2->sha256sum && *fpv2->sha256sum ==
- "088068ea3d69542a153f829cf836013374763148fba0a43d8047974f58b5efd7");
+ "75d2a7d3eec62d63afd3d3a84d91bd02b05ecb16cd0907d5b0db1fc654e3753f");
assert (!fpv2->buildable);
@@ -501,7 +500,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (fpv2a->internal_repository.load () == sr);
assert (fpv2a->other_repositories.empty ());
assert (fpv2a->priority == priority::security);
- assert (fpv2a->changes.empty ());
+ assert (!fpv2a->changes);
assert (fpv2a->license_alternatives.size () == 1);
assert (fpv2a->license_alternatives[0].size () == 1);
@@ -542,7 +541,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (check_location (fpv2a));
assert (fpv2a->sha256sum && *fpv2a->sha256sum ==
- "f5d3e9e6e8f9621a638b1375d31f0eb50e6279d8066170b25da21e84198cfd82");
+ "71321f6616036380ac5c9c5dc81efa04b23577ef9dc18f1ce413587bb57677c9");
assert (!fpv2a->buildable);
@@ -564,7 +563,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (fpv3->other_repositories.empty ());
assert (fpv3->priority == priority::medium);
- assert (fpv3->changes.empty ());
+ assert (!fpv3->changes);
assert (fpv3->license_alternatives.size () == 1);
assert (fpv3->license_alternatives[0].size () == 1);
@@ -580,7 +579,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (check_location (fpv3));
assert (fpv3->sha256sum && *fpv3->sha256sum ==
- "f2ebecac6cac8addd7c623bc1becf055e76b13a0d2dd385832b92c38c58956d8");
+ "24c53899bd4dbfdde6a727e07724984bfb4ca7f20142291c40e30304f15434c3");
assert (!fpv3->buildable);
@@ -592,7 +591,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (fpv4->summary == "The Foo Library");
assert (fpv4->keywords == labels ({"c++", "foo"}));
- assert (*fpv4->description == "Very good foo library.");
+ assert (fpv4->description->text == "Very good foo library.");
assert (fpv4->url && fpv4->url->string () == "http://www.example.com/foo/");
assert (!fpv4->package_url);
assert (fpv4->email && *fpv4->email == "foo-users@example.com");
@@ -601,7 +600,10 @@ test_pkg_repos (const cstrings& loader_args,
assert (fpv4->internal_repository.load () == sr);
assert (fpv4->other_repositories.empty ());
assert (fpv4->priority == priority::low);
- assert (fpv4->changes == "some changes 1\n\nsome changes 2");
+
+ assert (fpv4->changes &&
+ fpv4->changes->text == "some changes 1\n\nsome changes 2" &&
+ fpv4->changes->type == text_type::plain);
assert (fpv4->license_alternatives.size () == 1);
assert (fpv4->license_alternatives[0].comment ==
@@ -619,7 +621,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (check_location (fpv4));
assert (fpv4->sha256sum && *fpv4->sha256sum ==
- "aa1606323bfc59b70de642629dc5d8318cc5348e3646f90ed89406d975db1e1d");
+ "98f80ca0cd1c053fd45ab37f72a6a31f1a0304747c636822df8d573420284642");
assert (!fpv4->buildable);
@@ -687,7 +689,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (xpv->internal_repository.load () == mr);
assert (xpv->other_repositories.empty ());
assert (xpv->priority == priority::low);
- assert (xpv->changes.empty ());
+ assert (!xpv->changes);
assert (xpv->license_alternatives.size () == 1);
assert (xpv->license_alternatives[0].size () == 1);
@@ -708,7 +710,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (check_location (xpv));
assert (xpv->sha256sum && *xpv->sha256sum ==
- "1833906dd93ccc0cda832d6a1b3ef9ed7877bb9958b46d9b2666033d4a7919c9");
+ "aa52d5b49ee1bad825cd6bca554f72636e8451f93c74f9a443bafce3c2bf82c0");
assert (xpv->buildable);
@@ -725,7 +727,19 @@ test_pkg_repos (const cstrings& loader_args,
labels ({"math library", "math API", "libbaz fork"}));
assert (fpv5->keywords == labels ({"c++", "foo", "math", "best"}));
- assert (*fpv5->description ==
+ assert (fpv5->description->text ==
+ "A modern C++ library with easy to use linear algebra and lot "
+ "of optimization\ntools.\n\nThere are over 100 functions in "
+ "total with an extensive test suite. The API is\nsimilar to "
+ "~~mathlab~~ **MATLAB**.[^mathlab]\n\nUseful for conversion of "
+ "research code into production environments.\n"
+ "[^mathlab]: MATLAB Capabilities: TODO");
+
+ assert (fpv5->description->type == text_type::github_mark);
+
+ assert (fpv5->package_description->text ==
+ "This project builds and defines the build2 package for the "
+ "libfoo library.\n\n"
"A modern C++ library with easy to use linear algebra and lot "
"of optimization\ntools.\n\nThere are over 100 functions in "
"total with an extensive test suite. The API is\nsimilar to "
@@ -733,6 +747,8 @@ test_pkg_repos (const cstrings& loader_args,
"research code into production environments.\n"
"[^mathlab]: MATLAB Capabilities: TODO");
+ assert (fpv5->package_description->type == text_type::github_mark);
+
assert (fpv5->url && fpv5->url->string () == "http://www.example.com/foo/");
assert (fpv5->doc_url && fpv5->doc_url->string () ==
@@ -757,14 +773,16 @@ test_pkg_repos (const cstrings& loader_args,
assert (fpv5->priority.comment ==
"Critical bug fixes, performance improvement.");
- const char ch[] = R"DLM(1.2.4+1
+ const char ch[] = R"DLM(**1.2.4+1**
* applied patch for critical bug-219
* regenerated documentation
-1.2.4
+**1.2.4**
* test suite extended significantly)DLM";
- assert (fpv5->changes == ch);
+ assert (fpv5->changes &&
+ fpv5->changes->text == ch &&
+ fpv5->changes->type == text_type::github_mark);
assert (fpv5->license_alternatives.size () == 2);
assert (fpv5->license_alternatives[0].comment ==
@@ -844,7 +862,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (check_location (fpv5));
assert (fpv5->sha256sum && *fpv5->sha256sum ==
- "d23a7ff116ab7264c3d423af97e4830bdaa8c9101cd95b210b19a97bb8512b74");
+ "ffce9d3e3ca9899d3fd6da1f6b93c07cce2c3f6b7004948b59757dae420f801b");
assert (fpv5->buildable);
@@ -860,7 +878,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (epv->project == "mathLab");
assert (epv->summary == "The exponent");
assert (epv->keywords == labels ({"mathlab", "c++", "exponent"}));
- assert (epv->description && *epv->description ==
+ assert (epv->description && epv->description->text ==
"The exponent math function.");
assert (epv->url && epv->url->string () == "http://exp.example.com");
assert (!epv->package_url);
@@ -871,7 +889,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (epv->internal_repository.load () == mr);
assert (epv->other_repositories.empty ());
assert (epv->priority == priority (priority::low));
- assert (epv->changes.empty ());
+ assert (!epv->changes);
assert (epv->license_alternatives.size () == 1);
assert (epv->license_alternatives[0].size () == 1);
@@ -903,7 +921,7 @@ test_pkg_repos (const cstrings& loader_args,
assert (check_location (epv));
assert (epv->sha256sum && *epv->sha256sum ==
- "317c8c6f45d9dfdfdef3a823411920cecd51729c7c4f58f9a0b0bbd681c07bd6");
+ "d90cfe583890cd0c05cdfc204e69dd3b986c2da49851f7a87fa0ca870788ff79");
// Verify libpq package version.
//