@@ -217,21 +217,6 @@ void main() {
217
217
218
218
group ("importing" , () {
219
219
group ("emits a protocol error" , () {
220
- test ("for an unset import result" , () async {
221
- process.inbound.add (compileString ("@import 'other'" , importers: [
222
- InboundMessage_CompileRequest_Importer ()..importerId = 1
223
- ]));
224
- await _canonicalize (process);
225
-
226
- var import = getImportRequest (await process.outbound.next);
227
- process.inbound.add (InboundMessage ()
228
- ..importResponse = (InboundMessage_ImportResponse ()..id = import.id));
229
-
230
- await _expectImportParamsError (
231
- process, "Missing mandatory field ImportResponse.result" );
232
- await process.kill ();
233
- });
234
-
235
220
test ("for an import result with a relative sourceMapUrl" , () async {
236
221
process.inbound.add (compileString ("@import 'other'" , importers: [
237
222
InboundMessage_CompileRequest_Importer ()..importerId = 1
@@ -289,6 +274,29 @@ void main() {
289
274
});
290
275
});
291
276
277
+ test ("null results count as not found" , () async {
278
+ process.inbound.add (compileString ("@import 'other'" , importers: [
279
+ InboundMessage_CompileRequest_Importer ()..importerId = 1
280
+ ]));
281
+
282
+ var canonicalizeRequest =
283
+ getCanonicalizeRequest (await process.outbound.next);
284
+ process.inbound.add (InboundMessage ()
285
+ ..canonicalizeResponse = (InboundMessage_CanonicalizeResponse ()
286
+ ..id = canonicalizeRequest.id
287
+ ..url = "o:other" ));
288
+
289
+ var importRequest = getImportRequest (await process.outbound.next);
290
+ process.inbound.add (InboundMessage ()
291
+ ..importResponse =
292
+ (InboundMessage_ImportResponse ()..id = importRequest.id));
293
+
294
+ var failure = getCompileFailure (await process.outbound.next);
295
+ expect (failure.message, equals ("Can't find stylesheet to import." ));
296
+ expect (failure.span.text, equals ("'other'" ));
297
+ await process.kill ();
298
+ });
299
+
292
300
test ("errors cause compilation to fail" , () async {
293
301
process.inbound.add (compileString ("@import 'other'" , importers: [
294
302
InboundMessage_CompileRequest_Importer ()..importerId = 1
0 commit comments