aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/tests_paragraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/tests_paragraph.cpp')
-rw-r--r--toolsrc/src/tests_paragraph.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/toolsrc/src/tests_paragraph.cpp b/toolsrc/src/tests_paragraph.cpp
index 1c77b437b..374e4ddd1 100644
--- a/toolsrc/src/tests_paragraph.cpp
+++ b/toolsrc/src/tests_paragraph.cpp
@@ -40,7 +40,12 @@ namespace UnitTest1
TEST_METHOD(SourceParagraph_Construct_Maximum)
{
auto m_pgh = vcpkg::SourceParagraph::parse_control_file({
- {"Source", "s"}, {"Version", "v"}, {"Maintainer", "m"}, {"Description", "d"}, {"Build-Depends", "bd"},
+ {"Source", "s"},
+ {"Version", "v"},
+ {"Maintainer", "m"},
+ {"Description", "d"},
+ {"Build-Depends", "bd"},
+ {"Supports", "x64"},
});
Assert::IsTrue(m_pgh.has_value());
auto& pgh = *m_pgh.get();
@@ -51,6 +56,8 @@ namespace UnitTest1
Assert::AreEqual("d", pgh.description.c_str());
Assert::AreEqual(size_t(1), pgh.depends.size());
Assert::AreEqual("bd", pgh.depends[0].name.c_str());
+ Assert::AreEqual(size_t(1), pgh.supports.size());
+ Assert::AreEqual("x64", pgh.supports[0].c_str());
}
TEST_METHOD(SourceParagraph_Two_Depends)
@@ -80,6 +87,20 @@ namespace UnitTest1
Assert::AreEqual("xyz", pgh.depends[2].name.c_str());
}
+ TEST_METHOD(SourceParagraph_Three_Supports)
+ {
+ auto m_pgh = vcpkg::SourceParagraph::parse_control_file({
+ {"Source", "zlib"}, {"Version", "1.2.8"}, {"Supports", "x64, windows, uwp"},
+ });
+ Assert::IsTrue(m_pgh.has_value());
+ auto& pgh = *m_pgh.get();
+
+ Assert::AreEqual(size_t(3), pgh.supports.size());
+ Assert::AreEqual("x64", pgh.supports[0].c_str());
+ Assert::AreEqual("windows", pgh.supports[1].c_str());
+ Assert::AreEqual("uwp", pgh.supports[2].c_str());
+ }
+
TEST_METHOD(SourceParagraph_Construct_Qualified_Depends)
{
auto m_pgh = vcpkg::SourceParagraph::parse_control_file({