Add a trivial test

This commit is contained in:
Michael Pfaff 2023-06-29 00:46:49 -04:00
parent d3a4abe336
commit 0d232e69dc
Signed by: michael
GPG Key ID: CF402C4A012AA9D4
1 changed files with 11 additions and 0 deletions

View File

@ -15,3 +15,14 @@ pub fn cast<T: 'static, R: 'static>(t: T) -> Result<R, T> {
Err(t)
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test_cast() {
assert_eq!(cast::<_, &'static str>("foo"), Ok("foo"));
assert_eq!(cast::<_, &'static str>(4), Err(4));
}
}