test_dadk_manifest.rs 842 B

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