mirror of
https://github.com/danog/dart-sass.git
synced 2024-12-11 08:40:02 +01:00
bc7216a441
This also adds a Value.tryMap() function, which was useful for implementing this and may be more generally useful to users as well. See sass/sass#2836 See sass/sass-spec#1560
35 lines
931 B
Dart
35 lines
931 B
Dart
// Copyright 2018 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.
|
|
|
|
@TestOn("vm")
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
import 'package:sass/sass.dart';
|
|
|
|
import 'utils.dart';
|
|
|
|
void main() {
|
|
Value value;
|
|
setUp(() => value = parseValue("null"));
|
|
|
|
test("is falsey", () {
|
|
expect(value.isTruthy, isFalse);
|
|
});
|
|
|
|
test("is sassNull", () {
|
|
expect(value, equalsWithHash(sassNull));
|
|
});
|
|
|
|
test("isn't any type", () {
|
|
expect(value.assertBoolean, throwsSassScriptException);
|
|
expect(value.assertColor, throwsSassScriptException);
|
|
expect(value.assertFunction, throwsSassScriptException);
|
|
expect(value.assertMap, throwsSassScriptException);
|
|
expect(value.tryMap(), isNull);
|
|
expect(value.assertNumber, throwsSassScriptException);
|
|
expect(value.assertString, throwsSassScriptException);
|
|
});
|
|
}
|