feat: Add sal-net package to workspace
Some checks are pending
Rhai Tests / Run Rhai Tests (push) Waiting to run

- Add new sal-net package to the workspace.
- Update MONOREPO_CONVERSION_PLAN.md to reflect the
  addition of the sal-net package and mark it as
  production-ready.
- Add Cargo.toml and README.md for the sal-net package.
This commit is contained in:
Mahmoud-Emad
2025-06-22 09:52:20 +03:00
parent d22fd686b7
commit 74217364fa
23 changed files with 2540 additions and 158 deletions

View File

@@ -420,12 +420,43 @@ mod tests {
#[test]
fn test_platform_detection() {
// This test will return different results depending on the platform it's run on
// Test that platform detection returns a valid platform
let platform = Platform::detect();
println!("Detected platform: {:?}", platform);
// Just ensure it doesn't panic
assert!(true);
// Verify that we get one of the expected platform values
match platform {
Platform::Ubuntu | Platform::MacOS | Platform::Unknown => {
// All valid platforms
}
}
// Test that detection is consistent (calling it twice should return the same result)
let platform2 = Platform::detect();
assert_eq!(platform, platform2);
// Test that the platform detection logic makes sense for the current environment
match platform {
Platform::MacOS => {
// If detected as macOS, sw_vers should exist
assert!(std::path::Path::new("/usr/bin/sw_vers").exists());
}
Platform::Ubuntu => {
// If detected as Ubuntu, lsb-release should exist and contain "Ubuntu"
assert!(std::path::Path::new("/etc/lsb-release").exists());
if let Ok(content) = std::fs::read_to_string("/etc/lsb-release") {
assert!(content.contains("Ubuntu"));
}
}
Platform::Unknown => {
// If unknown, neither macOS nor Ubuntu indicators should be present
// (or Ubuntu file exists but doesn't contain "Ubuntu")
if std::path::Path::new("/usr/bin/sw_vers").exists() {
// This shouldn't happen - if sw_vers exists, it should be detected as macOS
panic!("sw_vers exists but platform detected as Unknown");
}
}
}
}
#[test]