@@ -217,21 +217,6 @@ void main() {
217217
218218 group ("importing" , () {
219219 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-
235220 test ("for an import result with a relative sourceMapUrl" , () async {
236221 process.inbound.add (compileString ("@import 'other'" , importers: [
237222 InboundMessage_CompileRequest_Importer ()..importerId = 1
@@ -289,6 +274,29 @@ void main() {
289274 });
290275 });
291276
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+
292300 test ("errors cause compilation to fail" , () async {
293301 process.inbound.add (compileString ("@import 'other'" , importers: [
294302 InboundMessage_CompileRequest_Importer ()..importerId = 1
0 commit comments