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

Side by Side Diff: tests/lib/crypto/base64_test.dart

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated latest tests. Created 7 years, 9 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 | Annotate | Revision Log
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 the test to run on Dartium. 5 // Library tag to allow the test to run on Dartium.
6 library base64_test; 6 library base64_test;
7 7
8 import "package:expect/expect.dart";
8 import 'dart:crypto'; 9 import 'dart:crypto';
9 10
10 // Data from http://tools.ietf.org/html/rfc4648. 11 // Data from http://tools.ietf.org/html/rfc4648.
11 var inputs = 12 var inputs =
12 const [ '', 'f', 'fo', 'foo', 'foob', 'fooba', 'foobar' ]; 13 const [ '', 'f', 'fo', 'foo', 'foob', 'fooba', 'foobar' ];
13 var results = 14 var results =
14 const [ '', 'Zg==', 'Zm8=', 'Zm9v', 'Zm9vYg==', 'Zm9vYmE=', 'Zm9vYmFy' ]; 15 const [ '', 'Zg==', 'Zm8=', 'Zm9v', 'Zm9vYg==', 'Zm9vYmE=', 'Zm9vYmFy' ];
15 16
16 var longLine = 17 var longLine =
17 "Man is distinguished, not only by his reason, but by this singular " 18 "Man is distinguished, not only by his reason, but by this singular "
(...skipping 28 matching lines...) Expand all
46 void main() { 47 void main() {
47 for (var i = 0; i < inputs.length; i++) { 48 for (var i = 0; i < inputs.length; i++) {
48 var enc = CryptoUtils.bytesToBase64(inputs[i].codeUnits); 49 var enc = CryptoUtils.bytesToBase64(inputs[i].codeUnits);
49 Expect.equals(results[i], enc); 50 Expect.equals(results[i], enc);
50 } 51 }
51 Expect.equals(CryptoUtils.bytesToBase64(longLine.codeUnits, 76), 52 Expect.equals(CryptoUtils.bytesToBase64(longLine.codeUnits, 76),
52 longLineResult); 53 longLineResult);
53 Expect.equals(CryptoUtils.bytesToBase64(longLine.codeUnits), 54 Expect.equals(CryptoUtils.bytesToBase64(longLine.codeUnits),
54 longLineResultNoBreak); 55 longLineResultNoBreak);
55 } 56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698