Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: test/sha1_test.dart

Issue 1350913002: Run the formatter over crypto. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Fix a missing value. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/hmac_sha256_test.dart ('k') | test/sha256_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 tag to allow dartium to run the test. 5 // Library tag to allow dartium to run the test.
6 library sha1_test; 6 library sha1_test;
7 7
8 import "package:crypto/crypto.dart"; 8 import "package:crypto/crypto.dart";
9 import "package:test/test.dart"; 9 import "package:test/test.dart";
10 10
11 part 'sha1_long_test_vectors.dart'; 11 part 'sha1_long_test_vectors.dart';
12 part 'sha1_short_test_vectors.dart'; 12 part 'sha1_short_test_vectors.dart';
13 13
14
15 void main() { 14 void main() {
16 test('expected values', _testExpectedValues); 15 test('expected values', _testExpectedValues);
17 test('invalid use', _testInvalidUse); 16 test('invalid use', _testInvalidUse);
18 test('repeated digest', _testRepeatedDigest); 17 test('repeated digest', _testRepeatedDigest);
19 test('long inputs', () { 18 test('long inputs', () {
20 _testStandardVectors(sha1_long_inputs, sha1_long_mds); 19 _testStandardVectors(sha1_long_inputs, sha1_long_mds);
21 }); 20 });
22 test('short inputs', () { 21 test('short inputs', () {
23 _testStandardVectors(sha1_short_inputs, sha1_short_mds); 22 _testStandardVectors(sha1_short_inputs, sha1_short_mds);
24 }); 23 });
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 } 559 }
561 560
562 void _testStandardVectors(inputs, mds) { 561 void _testStandardVectors(inputs, mds) {
563 for (var i = 0; i < inputs.length; i++) { 562 for (var i = 0; i < inputs.length; i++) {
564 var hash = new SHA1(); 563 var hash = new SHA1();
565 hash.add(inputs[i]); 564 hash.add(inputs[i]);
566 var d = hash.close(); 565 var d = hash.close();
567 expect(mds[i], CryptoUtils.bytesToHex(d), reason: '$i'); 566 expect(mds[i], CryptoUtils.bytesToHex(d), reason: '$i');
568 } 567 }
569 } 568 }
OLDNEW
« no previous file with comments | « test/hmac_sha256_test.dart ('k') | test/sha256_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698