aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/vcpkg-test
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2020-02-09 14:50:26 -0800
committerGitHub <noreply@github.com>2020-02-09 14:50:26 -0800
commita33044c18637d3df6de93128d33dae1fb5ba575c (patch)
tree273838dd27daed933e63bc7d29a28b569557755f /toolsrc/include/vcpkg-test
parent039098c9546195a50e45c41e37d7e2b9168b4245 (diff)
downloadvcpkg-a33044c18637d3df6de93128d33dae1fb5ba575c.tar.gz
vcpkg-a33044c18637d3df6de93128d33dae1fb5ba575c.zip
[vcpkg] Track parser row/col state in Paragraph (renamed from RawParagraph) (#9987)
Diffstat (limited to 'toolsrc/include/vcpkg-test')
-rw-r--r--toolsrc/include/vcpkg-test/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg-test/util.h b/toolsrc/include/vcpkg-test/util.h
index d8ecc51ea..c15846d05 100644
--- a/toolsrc/include/vcpkg-test/util.h
+++ b/toolsrc/include/vcpkg-test/util.h
@@ -23,6 +23,18 @@ namespace vcpkg::Test
const std::vector<std::pair<const char*, const char*>>& features = {},
const std::vector<const char*>& default_features = {});
+ inline auto test_parse_control_file(const std::vector<std::unordered_map<std::string, std::string>>& v)
+ {
+ std::vector<vcpkg::Parse::Paragraph> pghs;
+ for (auto&& p : v)
+ {
+ pghs.emplace_back();
+ for (auto&& kv : p)
+ pghs.back().emplace(kv.first, std::make_pair(kv.second, vcpkg::Parse::TextRowCol{}));
+ }
+ return vcpkg::SourceControlFile::parse_control_file("", std::move(pghs));
+ }
+
std::unique_ptr<vcpkg::StatusParagraph> make_status_pgh(const char* name,
const char* depends = "",
const char* default_features = "",