@@ -336,7 +336,7 @@ impl TerraphimGrep {
336336mod tests {
337337 use super :: * ;
338338 #[ cfg( feature = "code-search" ) ]
339- use terraphim_types:: Thesaurus ;
339+ use terraphim_types:: { NormalizedTerm , NormalizedTermValue , Thesaurus } ;
340340
341341 #[ test]
342342 fn test_grep_options_default ( ) {
@@ -454,7 +454,13 @@ mod tests {
454454 let path = tmp. path ( ) . join ( "only_match.rs" ) ;
455455 std:: fs:: write ( & path, "fn unique_target() { /* unique_target */ }\n " ) . unwrap ( ) ;
456456
457- let hybrid = HybridSearcher :: new ( "test-role" . to_string ( ) , Thesaurus :: new ( "t" . to_string ( ) ) )
457+ let mut thesaurus = Thesaurus :: new ( "t" . to_string ( ) ) ;
458+ let concept_key = NormalizedTermValue :: from ( "unique_target" ) ;
459+ let concept = NormalizedTerm :: new ( 1 , concept_key. clone ( ) )
460+ . with_display_value ( "unique_target" . to_string ( ) ) ;
461+ thesaurus. insert ( concept_key, concept) ;
462+
463+ let hybrid = HybridSearcher :: new ( "test-role" . to_string ( ) , thesaurus)
458464 . expect ( "build hybrid searcher" )
459465 . with_search_path ( tmp. path ( ) . to_path_buf ( ) ) ;
460466 let grep = TerraphimGrep :: new ( Arc :: new ( hybrid) , Arc :: new ( SufficiencyJudge :: default ( ) ) ) ;
@@ -490,6 +496,14 @@ mod tests {
490496 result. concepts. len( ) ,
491497 "stats.kg_hits must equal concepts.len() when concepts are retained"
492498 ) ;
499+ assert ! ( result. stats. kg_hits > 0 , "fixture must produce a KG hit" ) ;
500+ assert ! (
501+ result
502+ . concepts
503+ . iter( )
504+ . any( |concept| concept. name == "unique_target" ) ,
505+ "the known KG concept must survive the RlmInsufficient branch"
506+ ) ;
493507 }
494508
495509 /// The RLM prompt for `include_answer` must embed the `AnswerSignature`
0 commit comments