source · Rust

Lib

crates/vak-config/src/lib.rs
Raw
212.9 KB5,694 lines129 anchorsSnapshot ed4ab258
  1. 5665 );
  2. 5666 assert!(
  3. 5667 merged
  4. 5668 .plugins_network_deny
  5. 5669 .contains(&"test-plugin-a".to_string())
  6. 5670 );
  7. 5671 }
  8. 5672
  9. 5673 /// The persisted TOML field was renamed from `subagents` to `workers`.
  10. 5674 /// An existing `vak.toml` with the old key (and no `workers` key) must
  11. 5675 /// still be honored rather than silently falling back to the default.
  12. 5676 #[test]
  13. 5677 fn legacy_subagents_key_is_honored_as_workers() {
  14. 5678 let dir = tempfile::tempdir().unwrap();
  15. 5679 let path = project_path(dir.path());
  16. 5680 std::fs::create_dir_all(path.parent().unwrap()).unwrap();
  17. 5681 std::fs::write(&path, "subagents = false\n").unwrap();
  18. 5682
  19. 5683 let (fc, warnings) = parse_file(&path).unwrap();
  20. 5684 assert_eq!(fc.workers, Some(false));
  21. 5685 assert!(
  22. 5686 warnings.is_empty(),
  23. 5687 "legacy `subagents` key should not warn as unknown: {warnings:?}"
  24. 5688 );
  25. 5689
  26. 5690 let cfg = load_with_trust(dir.path(), true).unwrap();
  27. 5691 assert!(!cfg.workers);
  28. 5692 }
  29. 5693}
  30. 5694