aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg-tests/update.cpp
diff options
context:
space:
mode:
authorNicole Mazzuca <mazzucan@outlook.com>2019-07-19 23:20:28 -0700
committerNicole Mazzuca <mazzucan@outlook.com>2019-07-19 23:20:28 -0700
commit0d8bba52e4c0a861b25f9d32006bfde9b749e09f (patch)
tree5e0a29aeb6b3aa79925ca1191ea41129484f48e2 /toolsrc/src/vcpkg-tests/update.cpp
parentc55ea0a0d5229b9dd79aa8ea888f6c0408f9e5dd (diff)
downloadvcpkg-0d8bba52e4c0a861b25f9d32006bfde9b749e09f.tar.gz
vcpkg-0d8bba52e4c0a861b25f9d32006bfde9b749e09f.zip
allow tests to run on older standard libraries
Diffstat (limited to 'toolsrc/src/vcpkg-tests/update.cpp')
-rw-r--r--toolsrc/src/vcpkg-tests/update.cpp102
1 files changed, 0 insertions, 102 deletions
diff --git a/toolsrc/src/vcpkg-tests/update.cpp b/toolsrc/src/vcpkg-tests/update.cpp
deleted file mode 100644
index 93a8f74a9..000000000
--- a/toolsrc/src/vcpkg-tests/update.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-#include <vcpkg-tests/catch.h>
-#include <vcpkg-tests/util.h>
-
-#include <vcpkg/base/sortedvector.h>
-
-#include <vcpkg/update.h>
-
-using namespace vcpkg;
-using namespace vcpkg::Update;
-using namespace vcpkg::Test;
-
-using Pgh = std::vector<std::unordered_map<std::string, std::string>>;
-
-TEST_CASE ("find outdated packages basic", "[update]")
-{
- std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs;
- status_paragraphs.push_back(make_status_pgh("a"));
- status_paragraphs.back()->package.version = "2";
-
- StatusParagraphs status_db(std::move(status_paragraphs));
-
- std::unordered_map<std::string, SourceControlFileLocation> map;
- auto scf = unwrap(SourceControlFile::parse_control_file(Pgh{{{"Source", "a"}, {"Version", "0"}}}));
- map.emplace("a", SourceControlFileLocation{std::move(scf), ""});
- Dependencies::MapPortFileProvider provider(map);
-
- auto pkgs = SortedVector<OutdatedPackage>(Update::find_outdated_packages(provider, status_db),
- &OutdatedPackage::compare_by_name);
-
- REQUIRE(pkgs.size() == 1);
- REQUIRE(pkgs[0].version_diff.left.to_string() == "2");
- REQUIRE(pkgs[0].version_diff.right.to_string() == "0");
-}
-
-TEST_CASE ("find outdated packages features", "[update]")
-{
- std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs;
- status_paragraphs.push_back(make_status_pgh("a"));
- status_paragraphs.back()->package.version = "2";
-
- status_paragraphs.push_back(make_status_feature_pgh("a", "b"));
- status_paragraphs.back()->package.version = "2";
-
- StatusParagraphs status_db(std::move(status_paragraphs));
-
- std::unordered_map<std::string, SourceControlFileLocation> map;
- auto scf = unwrap(SourceControlFile::parse_control_file(Pgh{{{"Source", "a"}, {"Version", "0"}}}));
- map.emplace("a", SourceControlFileLocation{std::move(scf), ""});
- Dependencies::MapPortFileProvider provider(map);
-
- auto pkgs = SortedVector<OutdatedPackage>(Update::find_outdated_packages(provider, status_db),
- &OutdatedPackage::compare_by_name);
-
- REQUIRE(pkgs.size() == 1);
- REQUIRE(pkgs[0].version_diff.left.to_string() == "2");
- REQUIRE(pkgs[0].version_diff.right.to_string() == "0");
-}
-
-TEST_CASE ("find outdated packages features 2", "[update]")
-{
- std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs;
- status_paragraphs.push_back(make_status_pgh("a"));
- status_paragraphs.back()->package.version = "2";
-
- status_paragraphs.push_back(make_status_feature_pgh("a", "b"));
- status_paragraphs.back()->package.version = "0";
- status_paragraphs.back()->state = InstallState::NOT_INSTALLED;
- status_paragraphs.back()->want = Want::PURGE;
-
- StatusParagraphs status_db(std::move(status_paragraphs));
-
- std::unordered_map<std::string, SourceControlFileLocation> map;
- auto scf = unwrap(SourceControlFile::parse_control_file(Pgh{{{"Source", "a"}, {"Version", "0"}}}));
- map.emplace("a", SourceControlFileLocation{std::move(scf), ""});
- Dependencies::MapPortFileProvider provider(map);
-
- auto pkgs = SortedVector<OutdatedPackage>(Update::find_outdated_packages(provider, status_db),
- &OutdatedPackage::compare_by_name);
-
- REQUIRE(pkgs.size() == 1);
- REQUIRE(pkgs[0].version_diff.left.to_string() == "2");
- REQUIRE(pkgs[0].version_diff.right.to_string() == "0");
-}
-
-TEST_CASE ("find outdated packages none", "[update]")
-{
- std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs;
- status_paragraphs.push_back(make_status_pgh("a"));
- status_paragraphs.back()->package.version = "2";
-
- StatusParagraphs status_db(std::move(status_paragraphs));
-
- std::unordered_map<std::string, SourceControlFileLocation> map;
- auto scf = unwrap(SourceControlFile::parse_control_file(Pgh{{{"Source", "a"}, {"Version", "2"}}}));
- map.emplace("a", SourceControlFileLocation{std::move(scf), ""});
- Dependencies::MapPortFileProvider provider(map);
-
- auto pkgs = SortedVector<OutdatedPackage>(Update::find_outdated_packages(provider, status_db),
- &OutdatedPackage::compare_by_name);
-
- REQUIRE(pkgs.size() == 0);
-}