OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 @TestOn("vm") | |
6 | |
7 import 'dart:io'; | |
kevmoo
2016/02/03 23:01:56
dart:io, path, scheduled_stream are unused
| |
8 import 'dart:convert'; | |
9 | |
10 import 'package:path/path.dart' as p; | |
11 import 'package:scheduled_test/descriptor.dart' as d; | |
12 import 'package:scheduled_test/scheduled_stream.dart'; | |
13 import 'package:scheduled_test/scheduled_test.dart'; | |
14 import 'package:test/src/util/exit_codes.dart' as exit_codes; | |
15 | |
16 import '../../io.dart'; | |
17 | |
18 void main() { | |
19 useSandbox(); | |
20 | |
21 test("rejects an invalid verbose_trace", () { | |
22 d.file("dart_test.yaml", JSON.encode({ | |
23 "verbose_trace": "flup" | |
24 })).create(); | |
25 | |
26 var test = runTest(["test.dart"]); | |
27 test.stderr.expect(containsInOrder([ | |
28 "verbose_trace must be a boolean", | |
29 "^^^^^^" | |
30 ])); | |
31 test.shouldExit(exit_codes.data); | |
32 }); | |
33 | |
34 test("rejects an invalid js_trace", | |
35 () { | |
36 d.file("dart_test.yaml", JSON.encode({ | |
37 "js_trace": "flup" | |
38 })).create(); | |
39 | |
40 var test = runTest(["test.dart"]); | |
41 test.stderr.expect(containsInOrder([ | |
42 "js_trace must be a boolean", | |
43 "^^^^^^" | |
44 ])); | |
45 test.shouldExit(exit_codes.data); | |
46 }); | |
47 | |
48 test("rejects an invalid reporter type", () { | |
49 d.file("dart_test.yaml", JSON.encode({ | |
50 "reporter": 12 | |
51 })).create(); | |
52 | |
53 var test = runTest(["test.dart"]); | |
54 test.stderr.expect(containsInOrder([ | |
55 "reporter must be a string", | |
56 "^^" | |
57 ])); | |
58 test.shouldExit(exit_codes.data); | |
59 }); | |
60 | |
61 test("rejects an invalid reporter name", () { | |
62 d.file("dart_test.yaml", JSON.encode({ | |
63 "reporter": "non-existent" | |
64 })).create(); | |
65 | |
66 var test = runTest(["test.dart"]); | |
67 test.stderr.expect(containsInOrder([ | |
68 'Unknown reporter "non-existent"', | |
69 "^^^^^^^^^^^^^^" | |
70 ])); | |
71 test.shouldExit(exit_codes.data); | |
72 }); | |
73 | |
74 test("rejects an invalid pub serve port", () { | |
75 d.file("dart_test.yaml", JSON.encode({ | |
76 "pub_serve": "foo" | |
77 })).create(); | |
78 | |
79 var test = runTest(["test.dart"]); | |
80 test.stderr.expect(containsInOrder([ | |
81 "pub_serve must be an int", | |
82 "^^^^^" | |
83 ])); | |
84 test.shouldExit(exit_codes.data); | |
85 }); | |
86 | |
87 test("rejects an invalid concurrency", () { | |
88 d.file("dart_test.yaml", JSON.encode({ | |
89 "concurrency": "foo" | |
90 })).create(); | |
91 | |
92 var test = runTest(["test.dart"]); | |
93 test.stderr.expect(containsInOrder([ | |
94 "concurrency must be an int", | |
95 "^^^^^" | |
96 ])); | |
97 test.shouldExit(exit_codes.data); | |
98 }); | |
99 | |
100 test("rejects an invalid timeout type", () { | |
101 d.file("dart_test.yaml", JSON.encode({ | |
102 "timeout": 12 | |
103 })).create(); | |
104 | |
105 var test = runTest(["test.dart"]); | |
106 test.stderr.expect(containsInOrder([ | |
107 "timeout must be a string", | |
108 "^^" | |
109 ])); | |
110 test.shouldExit(exit_codes.data); | |
111 }); | |
112 | |
113 test("rejects an invalid timeout format", () { | |
114 d.file("dart_test.yaml", JSON.encode({ | |
115 "timeout": "12p" | |
116 })).create(); | |
117 | |
118 var test = runTest(["test.dart"]); | |
119 test.stderr.expect(containsInOrder([ | |
120 "Invalid timeout: expected unit", | |
121 "^^^^^" | |
122 ])); | |
123 test.shouldExit(exit_codes.data); | |
124 }); | |
125 | |
126 test("rejects an invalid platforms list type", () { | |
127 d.file("dart_test.yaml", JSON.encode({ | |
128 "platforms": "vm" | |
129 })).create(); | |
130 | |
131 var test = runTest(["test.dart"]); | |
132 test.stderr.expect(containsInOrder([ | |
133 "platforms must be a list", | |
134 "^^^^" | |
135 ])); | |
136 test.shouldExit(exit_codes.data); | |
137 }); | |
138 | |
139 test("rejects an invalid platforms member type", () { | |
140 d.file("dart_test.yaml", JSON.encode({ | |
141 "platforms": [12] | |
142 })).create(); | |
143 | |
144 var test = runTest(["test.dart"]); | |
145 test.stderr.expect(containsInOrder([ | |
146 "Platforms must be strings", | |
147 "^^" | |
148 ])); | |
149 test.shouldExit(exit_codes.data); | |
150 }); | |
151 | |
152 test("rejects an invalid platforms member name", () { | |
153 d.file("dart_test.yaml", JSON.encode({ | |
154 "platforms": ["foo"] | |
155 })).create(); | |
156 | |
157 var test = runTest(["test.dart"]); | |
158 test.stderr.expect(containsInOrder([ | |
159 'Unknown platform "foo"', | |
160 "^^^^^" | |
161 ])); | |
162 test.shouldExit(exit_codes.data); | |
163 }); | |
164 } | |
OLD | NEW |