#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct MemoryInfo {
pub total_bytes: u64,
pub available_bytes: u64,
}
#[must_use]
pub(super) fn probe() -> MemoryInfo {
MemoryInfo::default()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_default_total_bytes_is_zero() {
assert_eq!(MemoryInfo::default().total_bytes, 0);
}
#[test]
fn test_default_available_bytes_is_zero() {
assert_eq!(MemoryInfo::default().available_bytes, 0);
}
#[test]
fn test_probe_matches_default_in_foundation_phase() {
assert_eq!(probe(), MemoryInfo::default());
}
#[test]
fn test_probe_returns_owned_value_each_call() {
let a = probe();
let b = probe();
assert_eq!(a, b);
}
}