OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library usage.uuid_test; | 5 library usage.uuid_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:test/test.dart'; |
8 import 'package:usage/src/uuid.dart'; | 8 import 'package:usage/src/uuid.dart'; |
9 | 9 |
| 10 main() => defineTests(); |
| 11 |
10 void defineTests() { | 12 void defineTests() { |
11 group('uuid', () { | 13 group('uuid', () { |
12 // xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx | 14 // xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx |
13 test('simple', () { | 15 test('simple', () { |
14 Uuid uuid = new Uuid(); | 16 Uuid uuid = new Uuid(); |
15 String result = uuid.generateV4(); | 17 String result = uuid.generateV4(); |
16 expect(result.length, 36); | 18 expect(result.length, 36); |
17 expect(result[8], '-'); | 19 expect(result[8], '-'); |
18 expect(result[13], '-'); | 20 expect(result[13], '-'); |
19 expect(result[18], '-'); | 21 expect(result[18], '-'); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 64 |
63 uuid = new Uuid(); | 65 uuid = new Uuid(); |
64 for (int i = 0; i < 64; i++) { | 66 for (int i = 0; i < 64; i++) { |
65 String val = uuid.generateV4(); | 67 String val = uuid.generateV4(); |
66 expect(set, isNot(contains(val))); | 68 expect(set, isNot(contains(val))); |
67 set.add(val); | 69 set.add(val); |
68 } | 70 } |
69 }); | 71 }); |
70 }); | 72 }); |
71 } | 73 } |
OLD | NEW |