feat(serial):基本完成UUID和Short UUID的生成功能。
This commit is contained in:
20
tests/serial_codes.rs
Normal file
20
tests/serial_codes.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
#[cfg(test)]
|
||||
mod uuid_test {
|
||||
#[test]
|
||||
fn gen_uuid() {
|
||||
let uuid = rs_toolbox::serial_code::uuid::new();
|
||||
println!("{}", uuid);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod short_uuid_test {
|
||||
#[test]
|
||||
fn gen_short() {
|
||||
let short_uuid = rs_toolbox::serial_code::short_uuid::new(10);
|
||||
println!("{}", short_uuid);
|
||||
if short_uuid.len() != 10 {
|
||||
panic!("short_uuid length is not enough");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user