@@ -17,6 +17,8 @@ int main(int argc, char** argv)
1717 const char * yamlStr = R"(
1818 Git:
1919 URL: https://github.com/user/repo.git
20+ Branch: master
21+ FullHistory: true
2022 )" ;
2123
2224 ryml::Tree tree = ryml::parse_in_arena (c4::to_csubstr (yamlStr));
@@ -37,7 +39,9 @@ int main(int argc, char** argv)
3739 const runcpp2::Data::GitSource* git =
3840 mpark::get_if<runcpp2::Data::GitSource>(&dependencySource.Source );
3941 ssTEST_OUTPUT_ASSERT (" Should be Git source" , git != nullptr );
40- ssTEST_OUTPUT_ASSERT (" URL" , git->URL == " https://github.com/user/repo.git" );
42+ ssTEST_OUTPUT_ASSERT (" URL" , git->URL , " https://github.com/user/repo.git" );
43+ ssTEST_OUTPUT_ASSERT (" Branch" , git->Branch , " master" );
44+ ssTEST_OUTPUT_ASSERT (" FullHistory" , git->FullHistory , true );
4145
4246 // Test ToString() and Equals()
4347 ssTEST_OUTPUT_EXECUTION
@@ -184,9 +188,34 @@ int main(int argc, char** argv)
184188 bool parseResult = dependencySource.ParseYAML_Node (nodeRef);
185189 );
186190
187- ssTEST_OUTPUT_ASSERT (" ParseYAML_Node should fail" , ! parseResult);
191+ ssTEST_OUTPUT_ASSERT (" ParseYAML_Node should fail" , parseResult, false );
188192 };
189-
193+
194+ ssTEST (" DependencySource Should Handle Invalid FullHistory Option" )
195+ {
196+ ssTEST_OUTPUT_SETUP
197+ (
198+ const char * yamlStr = R"(
199+ Git:
200+ URL: https://github.com/user/repo.git
201+ FullHistory: What
202+ )" ;
203+
204+ ryml::Tree tree = ryml::parse_in_arena (c4::to_csubstr (yamlStr));
205+ ryml::ConstNodeRef root = tree.rootref ();
206+
207+ runcpp2::Data::DependencySource dependencySource;
208+ );
209+
210+ ssTEST_OUTPUT_EXECUTION
211+ (
212+ ryml::ConstNodeRef nodeRef = root;
213+ bool parseResult = dependencySource.ParseYAML_Node (nodeRef);
214+ );
215+
216+ ssTEST_OUTPUT_ASSERT (" ParseYAML_Node should fail" , parseResult, false );
217+ };
218+
190219 ssTEST_END_TEST_GROUP ();
191220 return 0 ;
192221}
0 commit comments