MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_builder_methods

Function test_builder_methods

core/src/prompts.rs:963–982  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

961
962 #[test]
963 fn test_builder_methods() {
964 let slots = SystemPromptSlots::default()
965 .with_style(AgentStyle::Plan)
966 .with_role("You are a Python expert")
967 .with_guidelines("Use type hints")
968 .with_response_style("Be brief")
969 .with_extra("Additional instructions");
970
971 assert_eq!(slots.style, Some(AgentStyle::Plan));
972 assert_eq!(slots.role, Some("You are a Python expert".to_string()));
973 assert_eq!(slots.guidelines, Some("Use type hints".to_string()));
974 assert_eq!(slots.response_style, Some("Be brief".to_string()));
975 assert_eq!(slots.extra, Some("Additional instructions".to_string()));
976
977 let built = slots.build();
978 assert!(built.contains("Python expert"));
979 assert!(built.contains("Use type hints"));
980 assert!(built.contains("Be brief"));
981 assert!(built.contains("Additional instructions"));
982 }
983
984 #[test]
985 fn test_code_review_guidelines_appended() {

Callers

nothing calls this directly

Calls 6

with_extraMethod · 0.80
with_response_styleMethod · 0.80
with_guidelinesMethod · 0.80
with_roleMethod · 0.80
with_styleMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected