2019-06-06 20:42:44 +02:00
|
|
|
// Copyright 2017 Google Inc. Use of this source code is governed by an
|
|
|
|
// MIT-style license that can be found in the LICENSE file or at
|
|
|
|
// https://opensource.org/licenses/MIT.
|
|
|
|
|
|
|
|
import 'package:sass/sass.dart';
|
|
|
|
|
|
|
|
/// An [Importer] whose [canonicalize] and [load] methods are provided by
|
|
|
|
/// closures.
|
|
|
|
class TestImporter extends Importer {
|
2021-03-17 04:51:32 +01:00
|
|
|
final Uri? Function(Uri url) _canonicalize;
|
|
|
|
final ImporterResult? Function(Uri url) _load;
|
2019-06-06 20:42:44 +02:00
|
|
|
|
|
|
|
TestImporter(this._canonicalize, this._load);
|
|
|
|
|
2021-03-17 04:51:32 +01:00
|
|
|
Uri? canonicalize(Uri url) => _canonicalize(url);
|
2019-06-06 20:42:44 +02:00
|
|
|
|
2021-03-17 04:51:32 +01:00
|
|
|
ImporterResult? load(Uri url) => _load(url);
|
2019-06-06 20:42:44 +02:00
|
|
|
}
|