feat: Add sal-net package to workspace
Some checks are pending
Rhai Tests / Run Rhai Tests (push) Waiting to run
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:
@@ -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]
|
||||
|
Reference in New Issue
Block a user