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

Side by Side Diff: third_party/pkg/angular/test/angular_spec.dart

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
(Empty)
1 library angular_spec;
2
3 import '_specs.dart';
4 import 'package:angular/utils.dart';
5
6 main() {
7 describe('angular.dart unittests', () {
8 it('should run in checked moded only', () {
9 expect(() {
10 dynamic v = 6;
11 String s = v;
12 }).toThrow();
13 });
14 });
15
16 describe('relaxFnApply', () {
17 it('should work with 6 arguments', () {
18 var sixArgs = [1, 1, 2, 3, 5, 8];
19 expect(relaxFnApply(() => "none", sixArgs)).toEqual("none");
20 expect(relaxFnApply((a) => a, sixArgs)).toEqual(1);
21 expect(relaxFnApply((a, b) => a + b, sixArgs)).toEqual(2);
22 expect(relaxFnApply((a, b, c) => a + b + c, sixArgs)).toEqual(4);
23 expect(relaxFnApply((a, b, c, d) => a + b + c + d, sixArgs)).toEqual(7);
24 expect(relaxFnApply((a, b, c, d, e) => a + b + c + d + e, sixArgs)).toEqua l(12);
25 });
26
27 it('should work with 0 arguments', () {
28 var noArgs = [];
29 expect(relaxFnApply(() => "none", noArgs)).toEqual("none");
30 expect(relaxFnApply(([a]) => a, noArgs)).toEqual(null);
31 expect(relaxFnApply(([a, b]) => b, noArgs)).toEqual(null);
32 expect(relaxFnApply(([a, b, c]) => c, noArgs)).toEqual(null);
33 expect(relaxFnApply(([a, b, c, d]) => d, noArgs)).toEqual(null);
34 expect(relaxFnApply(([a, b, c, d, e]) => e, noArgs)).toEqual(null);
35 });
36
37 it('should fail with not enough arguments', () {
38 expect(() {
39 relaxFnApply((required, alsoRequired) => "happy", [1]);
40 }).toThrow('Unknown function type, expecting 0 to 5 args.');
41 });
42 });
43 }
OLDNEW
« no previous file with comments | « third_party/pkg/angular/test/_specs_spec.dart ('k') | third_party/pkg/angular/test/bootstrap_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698