2018-01-13 02:08:53 +01:00
|
|
|
// 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';
|
|
|
|
|
2019-11-06 01:28:26 +01:00
|
|
|
void main() {
|
2021-03-17 03:25:39 +01:00
|
|
|
late Value value;
|
2018-01-13 02:08:53 +01:00
|
|
|
setUp(() => value = parseValue("null"));
|
|
|
|
|
2021-04-15 23:01:07 +02:00
|
|
|
test("is falsy", () {
|
2018-01-13 02:08:53 +01:00
|
|
|
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);
|
2020-09-16 01:23:01 +02:00
|
|
|
expect(value.tryMap(), isNull);
|
2018-01-13 02:08:53 +01:00
|
|
|
expect(value.assertNumber, throwsSassScriptException);
|
|
|
|
expect(value.assertString, throwsSassScriptException);
|
|
|
|
});
|
|
|
|
}
|