Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dipu-bd committed Sep 18, 2024
1 parent 91a945a commit abf9ac8
Showing 1 changed file with 25 additions and 32 deletions.
57 changes: 25 additions & 32 deletions test/random/uuid_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import 'package:hashlib/codecs.dart';
import 'package:hashlib/src/uuid.dart';
import 'package:test/test.dart';

@pragma('vm:entry-point')
void runIsolate(Function fn) {
fn();
}

void main() {
group('UUID v1', () {
test("known value", () {
Expand All @@ -30,12 +35,10 @@ void main() {
final seeds = await Future.wait(List.generate(
1000,
(_) => Isolate.spawn(
(e) => {},
null,
runIsolate,
uuid.v1,
errorsAreFatal: true,
).then((value) {
return uuid.v1();
}),
),
));
expect(seeds.toSet().length, 1000);
}, tags: ['vm-only']);
Expand All @@ -61,12 +64,10 @@ void main() {
final seeds = await Future.wait(List.generate(
1000,
(_) => Isolate.spawn(
(e) => {},
null,
runIsolate,
uuid.v3,
errorsAreFatal: true,
).then((value) {
return uuid.v3();
}),
),
));
expect(seeds.toSet().length, 1000);
}, tags: ['vm-only']);
Expand All @@ -92,12 +93,10 @@ void main() {
final seeds = await Future.wait(List.generate(
1000,
(_) => Isolate.spawn(
(e) => {},
null,
runIsolate,
uuid.v4,
errorsAreFatal: true,
).then((value) {
return uuid.v4();
}),
),
));
expect(seeds.toSet().length, 1000);
}, tags: ['vm-only']);
Expand All @@ -123,12 +122,10 @@ void main() {
final seeds = await Future.wait(List.generate(
1000,
(_) => Isolate.spawn(
(e) => {},
null,
runIsolate,
uuid.v5,
errorsAreFatal: true,
).then((value) {
return uuid.v5();
}),
),
));
expect(seeds.toSet().length, 1000);
}, tags: ['vm-only']);
Expand All @@ -155,12 +152,10 @@ void main() {
final seeds = await Future.wait(List.generate(
1000,
(_) => Isolate.spawn(
(e) => {},
null,
runIsolate,
uuid.v6,
errorsAreFatal: true,
).then((value) {
return uuid.v6();
}),
),
));
expect(seeds.toSet().length, 1000);
}, tags: ['vm-only']);
Expand All @@ -187,12 +182,10 @@ void main() {
final seeds = await Future.wait(List.generate(
1000,
(_) => Isolate.spawn(
(e) => {},
null,
runIsolate,
uuid.v7,
errorsAreFatal: true,
).then((value) {
return uuid.v7();
}),
),
));
expect(seeds.toSet().length, 1000);
}, tags: ['vm-only']);
Expand Down Expand Up @@ -237,8 +230,8 @@ void main() {
final seeds = await Future.wait(List.generate(
1000,
(_) => Isolate.spawn(
(e) => {},
null,
runIsolate,
uuid.v8,
errorsAreFatal: true,
).then((value) {
return uuid.v8();
Expand Down

0 comments on commit abf9ac8

Please sign in to comment.