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

Side by Side Diff: tests/compiler/dart2js/sha1_test.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 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
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 // This test is ripped from package:crypto to test the sha1 functionality copied 5 // This test is ripped from package:crypto to test the sha1 functionality copied
6 // into the compiler. 6 // into the compiler.
7 7
8 library sha1_test; 8 library sha1_test;
9
9 import 'package:compiler/src/hash/sha1.dart'; 10 import 'package:compiler/src/hash/sha1.dart';
10 11
11 import "package:unittest/unittest.dart"; 12 import "package:unittest/unittest.dart";
12 13
13 part 'sha1_long_test_vectors.dart'; 14 part 'sha1_long_test_vectors.dart';
14 part 'sha1_short_test_vectors.dart'; 15 part 'sha1_short_test_vectors.dart';
15 16
16
17 void main() { 17 void main() {
18 test('expected values', _testExpectedValues); 18 test('expected values', _testExpectedValues);
19 test('invalid use', _testInvalidUse); 19 test('invalid use', _testInvalidUse);
20 test('repeated digest', _testRepeatedDigest); 20 test('repeated digest', _testRepeatedDigest);
21 test('long inputs', () { 21 test('long inputs', () {
22 _testStandardVectors(sha1_long_inputs, sha1_long_mds); 22 _testStandardVectors(sha1_long_inputs, sha1_long_mds);
23 }); 23 });
24 test('short inputs', () { 24 test('short inputs', () {
25 _testStandardVectors(sha1_short_inputs, sha1_short_mds); 25 _testStandardVectors(sha1_short_inputs, sha1_short_mds);
26 }); 26 });
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 } 570 }
571 571
572 void _testStandardVectors(inputs, mds) { 572 void _testStandardVectors(inputs, mds) {
573 for (var i = 0; i < inputs.length; i++) { 573 for (var i = 0; i < inputs.length; i++) {
574 var hash = new SHA1(); 574 var hash = new SHA1();
575 hash.add(inputs[i]); 575 hash.add(inputs[i]);
576 var d = hash.close(); 576 var d = hash.close();
577 expect(mds[i], bytesToHex(d), reason: '$i'); 577 expect(mds[i], bytesToHex(d), reason: '$i');
578 } 578 }
579 } 579 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/setlet_test.dart ('k') | tests/compiler/dart2js/show_package_warnings_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698