You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let expected = r#"Inconsistent resolution order for module 'main'
1548
+
The compiler could not resolve the following conflicting import constraints:
1549
+
[lib/x, lib/y]
1550
+
[lib/y, lib/x]
1551
+
Try reordering your `use` statements to avoid cross-wiring."#
1552
+
.to_string();
1553
+
1554
+
assert_eq!(error.to_string(), expected);
1555
+
}
1556
+
1557
+
// --- Dependent File Error Display Tests ---
1558
+
1559
+
#[test]
1560
+
#[ignore = "TODO(Error_Formatting): The compiler currently strips the .simf extension from file paths during graph construction. This test expects the extension to be preserved."]
1561
+
fntest_display_error_in_imported_dependency(){
1562
+
let temp_dir = TempDir::new().unwrap();
1563
+
let root_path = create_simf_file(temp_dir.path(),"main.simf","use lib::math::add;");
"Graph construction should fail due to syntax error in dependency"
1583
+
);
1584
+
assert!(
1585
+
handler.has_errors(),
1586
+
"Handler should contain the imported module's error"
1587
+
);
1588
+
1589
+
let err_msg = ErrorCollector::to_string(&handler);
1590
+
1591
+
assert!(
1592
+
err_msg.contains("math.simf:1"),
1593
+
"Error should correctly display the file name math.simf and line number. Got:\n{}",
1594
+
err_msg
1595
+
);
1596
+
assert!(
1597
+
err_msg.contains("pub fn add(a: u32 b: u32) {}"),
1598
+
"Error should print the snippet from the imported file. Got:\n{}",
1599
+
err_msg
1600
+
);
1601
+
}
1602
+
1603
+
#[test]
1604
+
#[ignore = "TODO(Error_Formatting): The compiler currently strips the .simf extension from file paths during graph construction. This test expects the extension to be preserved."]
let err_msg = ErrorCollector::to_string(&handler);
1621
+
1622
+
assert!(
1623
+
err_msg.contains("A.simf:1"),
1624
+
"Error should point to A.simf where the bad import happened. Got:\n{}",
1625
+
err_msg
1626
+
);
1627
+
assert!(
1628
+
err_msg.contains("use lib::B::ghost;"),
1629
+
"Error should print the snippet from A.simf"
1630
+
);
1631
+
assert!(
1632
+
err_msg.contains("Unknown item `ghost`"),
1633
+
"Error should correctly identify the missing item"
1634
+
);
1635
+
}
1636
+
1637
+
#[test]
1638
+
#[ignore = "TODO(Error_Formatting): The compiler currently strips the .simf extension from file paths during graph construction. This test expects the extension to be preserved."]
0 commit comments