@@ -17,6 +17,9 @@ 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
22+ SubmoduleInitType: Full
2023 )" ;
2124
2225 ryml::Tree tree = ryml::parse_in_arena (c4::to_csubstr (yamlStr));
@@ -37,7 +40,12 @@ int main(int argc, char** argv)
3740 const runcpp2::Data::GitSource* git =
3841 mpark::get_if<runcpp2::Data::GitSource>(&dependencySource.Source );
3942 ssTEST_OUTPUT_ASSERT (" Should be Git source" , git != nullptr );
40- ssTEST_OUTPUT_ASSERT (" URL" , git->URL == " https://github.com/user/repo.git" );
43+ ssTEST_OUTPUT_ASSERT (" URL" , git->URL , " https://github.com/user/repo.git" );
44+ ssTEST_OUTPUT_ASSERT (" Branch" , git->Branch , " master" );
45+ ssTEST_OUTPUT_ASSERT (" FullHistory" , git->FullHistory , true );
46+ ssTEST_OUTPUT_ASSERT ( " SubmoduleInitType" ,
47+ git->CurrentSubmoduleInitType ==
48+ runcpp2::Data::SubmoduleInitType::FULL);
4149
4250 // Test ToString() and Equals()
4351 ssTEST_OUTPUT_EXECUTION
@@ -184,7 +192,57 @@ int main(int argc, char** argv)
184192 bool parseResult = dependencySource.ParseYAML_Node (nodeRef);
185193 );
186194
187- ssTEST_OUTPUT_ASSERT (" ParseYAML_Node should fail" , !parseResult);
195+ ssTEST_OUTPUT_ASSERT (" ParseYAML_Node should fail" , parseResult, false );
196+ };
197+
198+ ssTEST (" DependencySource Should Handle Invalid FullHistory Option" )
199+ {
200+ ssTEST_OUTPUT_SETUP
201+ (
202+ const char * yamlStr = R"(
203+ Git:
204+ URL: https://github.com/user/repo.git
205+ FullHistory: What
206+ )" ;
207+
208+ ryml::Tree tree = ryml::parse_in_arena (c4::to_csubstr (yamlStr));
209+ ryml::ConstNodeRef root = tree.rootref ();
210+
211+ runcpp2::Data::DependencySource dependencySource;
212+ );
213+
214+ ssTEST_OUTPUT_EXECUTION
215+ (
216+ ryml::ConstNodeRef nodeRef = root;
217+ bool parseResult = dependencySource.ParseYAML_Node (nodeRef);
218+ );
219+
220+ ssTEST_OUTPUT_ASSERT (" ParseYAML_Node should fail" , parseResult, false );
221+ };
222+
223+ ssTEST (" DependencySource Should Handle Invalid SubmoduleInitType Option" )
224+ {
225+ ssTEST_OUTPUT_SETUP
226+ (
227+ const char * yamlStr = R"(
228+ Git:
229+ URL: https://github.com/user/repo.git
230+ SubmoduleInitType: What
231+ )" ;
232+
233+ ryml::Tree tree = ryml::parse_in_arena (c4::to_csubstr (yamlStr));
234+ ryml::ConstNodeRef root = tree.rootref ();
235+
236+ runcpp2::Data::DependencySource dependencySource;
237+ );
238+
239+ ssTEST_OUTPUT_EXECUTION
240+ (
241+ ryml::ConstNodeRef nodeRef = root;
242+ bool parseResult = dependencySource.ParseYAML_Node (nodeRef);
243+ );
244+
245+ ssTEST_OUTPUT_ASSERT (" ParseYAML_Node should fail" , parseResult, false );
188246 };
189247
190248 ssTEST_END_TEST_GROUP ();
0 commit comments