File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1452,6 +1452,7 @@ class MonotonicUUIDsFactory
1452
1452
}
1453
1453
}
1454
1454
1455
+ // /
1455
1456
unittest
1456
1457
{
1457
1458
import std.conv : to;
@@ -1503,6 +1504,26 @@ unittest
1503
1504
}
1504
1505
}
1505
1506
1507
+ // /
1508
+ unittest
1509
+ {
1510
+ import std.datetime.stopwatch ;
1511
+
1512
+ auto f = new shared MonotonicUUIDsFactory;
1513
+
1514
+ UUID [100_000] uuids = void ;
1515
+
1516
+ auto sw = StopWatch(AutoStart.yes); // for debugging purposes
1517
+
1518
+ foreach (ref u; uuids)
1519
+ u = f.createUUIDv7_method3;
1520
+
1521
+ sw.stop;
1522
+
1523
+ foreach (i; 1 .. uuids.length)
1524
+ assert (uuids[i- 1 ].v7Timestamp_method3 < uuids[i].v7Timestamp_method3);
1525
+ }
1526
+
1506
1527
/**
1507
1528
* This function returns a timestamp + random based UUID aka. uuid v7.
1508
1529
*/
You can’t perform that action at this time.
0 commit comments