@@ -285,7 +285,11 @@ mod tests {
285285 editor_tree_generate_bundle, sorted_query_captures,
286286 } ;
287287 use crate :: { fol_tree_sitter_grammar, fol_tree_sitter_query_snapshots} ;
288- use std:: path:: PathBuf ;
288+ use std:: path:: { Path , PathBuf } ;
289+
290+ fn repo_root ( ) -> PathBuf {
291+ Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "../../.." ) . canonicalize ( ) . expect ( "repo root should resolve" )
292+ }
289293
290294 #[ test]
291295 fn lsp_entrypoint_summary_is_stable ( ) {
@@ -305,7 +309,7 @@ mod tests {
305309
306310 #[ test]
307311 fn file_backed_editor_commands_report_path_and_shape ( ) {
308- let path = PathBuf :: from ( "test/apps/fixtures/record_flow/main.fol" ) ;
312+ let path = repo_root ( ) . join ( "test/apps/fixtures/record_flow/main.fol" ) ;
309313 let parse = editor_parse_file ( & path) . unwrap ( ) ;
310314 let highlight = editor_highlight_file ( & path) . unwrap ( ) ;
311315 let symbols = editor_symbols_file ( & path) . unwrap ( ) ;
@@ -328,30 +332,34 @@ mod tests {
328332
329333 #[ test]
330334 fn real_fixtures_keep_editor_command_summaries_stable ( ) {
331- let showcase = PathBuf :: from ( "test/apps/showcases/full_v1_showcase/app/main.fol" ) ;
332- let package = PathBuf :: from ( "xtra/logtiny/src/log.fol" ) ;
335+ let showcase = repo_root ( ) . join ( "test/apps/showcases/full_v1_showcase/app/main.fol" ) ;
336+ let package = repo_root ( ) . join ( "xtra/logtiny/src/log.fol" ) ;
333337
334338 let parse = editor_parse_file ( & showcase) . unwrap ( ) ;
335339 let highlight = editor_highlight_file ( & showcase) . unwrap ( ) ;
336340 let symbols = editor_symbols_file ( & package) . unwrap ( ) ;
337341 let highlight_captures = sorted_query_captures ( crate :: fol_tree_sitter_highlights_query ( ) ) ;
338342
343+ let showcase_text = std:: fs:: read_to_string ( & showcase) . unwrap ( ) ;
344+ let showcase_lines = showcase_text. lines ( ) . count ( ) ;
345+ let showcase_bytes = showcase_text. len ( ) ;
346+
339347 assert_eq ! ( parse. command, "parse" ) ;
340348 assert_eq ! (
341349 parse. details,
342350 vec![
343- "path=test/apps/showcases/full_v1_showcase/app/main.fol" . to_string ( ) ,
344- "lines=98" . to_string ( ) ,
345- "bytes=2094" . to_string ( ) ,
351+ format! ( "path={}" , showcase . display ( ) ) ,
352+ format! ( "lines={showcase_lines}" ) ,
353+ format! ( "bytes={showcase_bytes}" ) ,
346354 format!( "grammar_bytes={}" , fol_tree_sitter_grammar( ) . len( ) ) ,
347355 ]
348356 ) ;
349357 assert_eq ! ( highlight. command, "highlight" ) ;
350358 assert_eq ! (
351359 highlight. details,
352360 vec![
353- "path=test/apps/showcases/full_v1_showcase/app/main.fol" . to_string ( ) ,
354- "lines=98" . to_string ( ) ,
361+ format! ( "path={}" , showcase . display ( ) ) ,
362+ format! ( "lines={showcase_lines}" ) ,
355363 format!(
356364 "query_bytes={}" ,
357365 crate :: fol_tree_sitter_highlights_query( ) . len( )
@@ -362,13 +370,20 @@ mod tests {
362370 "intrinsic_names=echo,eq,ge,gt,le,len,lt,not,nq" . to_string( ) ,
363371 ]
364372 ) ;
373+ let package_text = std:: fs:: read_to_string ( & package) . unwrap ( ) ;
374+ let package_lines = package_text. lines ( ) . count ( ) ;
375+ let package_symbol_candidates = package_text. matches ( "fun " ) . count ( )
376+ + package_text. matches ( "log " ) . count ( )
377+ + package_text. matches ( "typ " ) . count ( )
378+ + package_text. matches ( "ali " ) . count ( ) ;
379+
365380 assert_eq ! ( symbols. command, "symbols" ) ;
366381 assert_eq ! (
367382 symbols. details,
368383 vec![
369- "path=xtra/logtiny/src/log.fol" . to_string ( ) ,
370- "lines=52" . to_string ( ) ,
371- "symbol_candidates=8" . to_string ( ) ,
384+ format! ( "path={}" , package . display ( ) ) ,
385+ format! ( "lines={package_lines}" ) ,
386+ format! ( "symbol_candidates={package_symbol_candidates}" ) ,
372387 format!(
373388 "query_snapshots={}" ,
374389 fol_tree_sitter_query_snapshots( ) . len( )
0 commit comments