Skip to content

Commit 96f1a82

Browse files
committed
Unit tests for feature
1 parent 4f947b3 commit 96f1a82

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/model_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,29 +1493,36 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
14931493

14941494
group('Typedef', () {
14951495
Typedef t;
1496+
Typedef generic;
14961497

14971498
setUp(() {
14981499
t = exLibrary.typedefs.firstWhere((t) => t.name == 'processMessage');
1500+
generic = fakeLibrary.typedefs.firstWhere((t) => t.name == 'NewGenericTypedef');
14991501
});
15001502

15011503
test('has a fully qualified name', () {
15021504
expect(t.fullyQualifiedName, 'ex.processMessage');
1505+
expect(generic.fullyQualifiedName, 'fake.NewGenericTypedef');
15031506
});
15041507

15051508
test('has enclosing element', () {
15061509
expect(t.enclosingElement.name, equals(exLibrary.name));
1510+
expect(generic.enclosingElement.name, equals(fakeLibrary.name));
15071511
});
15081512

15091513
test('docs', () {
15101514
expect(t.documentation, equals(''));
1515+
expect(generic.documentation, equals('A typedef with the new style generic function syntax.'));
15111516
});
15121517

15131518
test('linked return type', () {
15141519
expect(t.linkedReturnType, equals('String'));
1520+
expect(generic.linkedReturnType, equals('List<T>'));
15151521
});
15161522

15171523
test("name with generics", () {
15181524
expect(t.nameWithGenerics, equals('processMessage<T>'));
1525+
expect(generic.nameWithGenerics, equals('NewGenericTypedef<T>'));
15191526
});
15201527
});
15211528

0 commit comments

Comments
 (0)