1 use dadk_config::{self, manifest::DadkManifestFile}; 2 use test_base::{ 3 dadk_config::DadkConfigTestContext, 4 test_context::{self as test_context, test_context}, 5 }; 6 7 const DADK_MANIFEST_FILE_NAME: &str = "dadk-manifest.toml"; 8 9 /// 测试加载模板目录中的 dadk-manifest.toml 文件,验证它能被加载成功,并且已经包含了所有字段 10 #[test_context(DadkConfigTestContext)] 11 #[test] 12 fn test_load_dadk_manifest_template(ctx: &DadkConfigTestContext) { 13 let manifest_path = ctx.templates_dir().join(DADK_MANIFEST_FILE_NAME); 14 assert_eq!(manifest_path.exists(), true); 15 assert_eq!(manifest_path.is_file(), true); 16 let manifest = DadkManifestFile::load(&manifest_path).expect("Failed to load manifest"); 17 // 验证 dadk-manifest.toml 已经包含了所有字段 18 assert_eq!(manifest.used_default, false); 19 } 20