Skip to content

Commit 17ac821

Browse files
committed
Refactoring tests and adding more test vectors
1 parent c4a0670 commit 17ac821

File tree

5 files changed

+757
-248
lines changed

5 files changed

+757
-248
lines changed

test/testrunners.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import 'utils/utils.dart';
1616
import 'utils/testrunner.dart' show TestRunner;
1717
import 'package:test/test.dart' show test;
1818

19+
// TestRunner implementations
1920
import 'webcrypto/aescbc_test.dart' as aescbc_test;
2021
import 'webcrypto/aesctr_test.dart' as aesctr_test;
2122
import 'webcrypto/aesgcm_test.dart' as aesgcm_test;
@@ -28,6 +29,10 @@ import 'webcrypto/rsaoaep_test.dart' as rsaoaep_test;
2829
import 'webcrypto/rsapss_test.dart' as rsapss_test;
2930
import 'webcrypto/rsassapkcs1v15_test.dart' as rsassapkcs1v15_test;
3031

32+
// Other test files, that don't use TestRunner
33+
import 'webcrypto/random_test.dart' as random_test;
34+
import 'webcrypto/digest_test.dart' as digest_test;
35+
3136
/// Test runners from all test files except `digest_test.dart` and
3237
/// `random_test.dart`, which do not use [TestRunner].
3338
final testRunners = <TestRunner>[
@@ -52,4 +57,7 @@ void runAllTests({TestFn test = test}) {
5257
for (final r in testRunners) {
5358
r.runTests(test: test);
5459
}
60+
// We don't use [TestRunner] for all tests, so we just add them manually.
61+
random_test.runTests(test: test);
62+
digest_test.runTests(test: test);
5563
}

test/utils/testrunner.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import 'utils.dart';
2525
import 'lipsum.dart';
2626
import 'err_stack_stub.dart' if (dart.library.ffi) 'err_stack_ffi.dart';
2727

28+
// Export utilities necessary for implementing a `TestRunner`.
29+
export 'utils.dart' show hashFromJson, curveFromJson;
30+
2831
List<int> _optionalBase64Decode(dynamic data) =>
2932
data == null ? null : base64.decode(data as String);
3033

0 commit comments

Comments
 (0)