-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathcontainer_modifiers_test.dart
35 lines (30 loc) · 1.14 KB
/
container_modifiers_test.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:dartdoc/src/model/container_modifiers.dart';
import 'package:dartdoc/src/model/language_feature.dart';
import 'package:test/test.dart';
extension TestChipsRenderer on Iterable<LanguageFeature> {
String asRenderedString() => map((l) => l.name).join(' ');
}
void main() {
group('fullKind string tests', () {
test('basic', () {
var l = [
ContainerModifier.base,
ContainerModifier.interface,
ContainerModifier.abstract
]..sort();
expect(l.asLanguageFeatureSet.asRenderedString(),
equals('abstract base interface'));
});
test('hide abstract on sealed', () {
var l = [ContainerModifier.abstract, ContainerModifier.sealed]..sort();
expect(l.asLanguageFeatureSet.asRenderedString(), equals('sealed'));
});
test('empty', () {
var l = <ContainerModifier>[];
expect(l.asLanguageFeatureSet.asRenderedString(), equals(''));
});
});
}