File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
/// The `test_directory.rs` module contains tests for the directory module.
2
2
pub mod test_directory;
3
3
4
+ /// The `test_uuid.rs` module contains tests for the UUID module.
5
+ pub mod test_uuid;
Original file line number Diff line number Diff line change
1
+ #[ cfg( test) ]
2
+ mod tests {
3
+ use libmake:: utilities:: uuid:: generate_unique_string;
4
+ use uuid:: Uuid ;
5
+
6
+ #[ test]
7
+ fn test_generate_unique_string_format ( ) {
8
+ let unique_string = generate_unique_string ( ) ;
9
+ let uuid = Uuid :: parse_str ( & unique_string) ;
10
+ assert ! ( uuid. is_ok( ) , "Generated string is not a valid UUID" ) ;
11
+ }
12
+
13
+ #[ test]
14
+ fn test_generate_unique_string_uniqueness ( ) {
15
+ let unique_string1 = generate_unique_string ( ) ;
16
+ let unique_string2 = generate_unique_string ( ) ;
17
+ assert_ne ! ( unique_string1, unique_string2, "Generated strings are not unique" ) ;
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments