-
-
Notifications
You must be signed in to change notification settings - Fork 170
Enhance Guid::from_values
and Guid::fmt
#280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Text of issue #279
|
I think currently there aren't any tests that explicitly check the functioning of the Guid code, although it's probably done implicitly by some of the other tests. To make sure the changes here behave as expected it would be good to add some unit tests to #[cfg(test)]
mod tests {
extern crate alloc;
use super::*;
#[test]
fn test_guid_display() {
assert_eq!(
alloc::format!(
"{}",
Guid::from_values(0x12345678, 0x9abc, 0xdef0, 0x1234, 0x56789abcdef0)
),
"12345678-9abc-def0-1234-56789abcdef0"
);
}
#[test]
fn test_unsafe_guid() {
#[unsafe_guid("12345678-9abc-def0-1234-56789abcdef0")]
struct X;
assert_eq!(
X::GUID,
Guid::from_values(0x12345678, 0x9abc, 0xdef0, 0x1234, 0x56789abcdef0)
);
}
} |
Got the tests added as well, they are both passing. Actually getting I noticed that all of the doctests were either ignored or failed compilation, I'm assuming from us either being in a |
The command used in CI is something like I've opened #281 to look into better documenting how to run the doc/unit tests. |
Guid::from_values
and Guid::fmt
PR for issue #279