@@ -418,6 +418,36 @@ void main() {
418
418
short = fakeLibrary.functions.firstWhere ((f) => f.name == 'short' );
419
419
});
420
420
421
+ group ('markdown extensions' , () {
422
+ Class DocumentWithATable ;
423
+ String docsAsHtml;
424
+
425
+ setUp (() {
426
+ DocumentWithATable = fakeLibrary.classes
427
+ .firstWhere ((cls) => cls.name == 'DocumentWithATable' );
428
+ docsAsHtml = DocumentWithATable .documentationAsHtml;
429
+ });
430
+
431
+ test ('Verify table appearance' , () {
432
+ expect (docsAsHtml.contains ('<table><thead><tr><th>Component</th>' ),
433
+ isTrue);
434
+ });
435
+
436
+ test ('Verify links inside of table headers' , () {
437
+ expect (
438
+ docsAsHtml.contains (
439
+ '<th><a href="fake/Annotation-class.html">Annotation</a></th>' ),
440
+ isTrue);
441
+ });
442
+
443
+ test ('Verify links inside of table body' , () {
444
+ expect (
445
+ docsAsHtml.contains (
446
+ '<tbody><tr><td><a href="fake/DocumentWithATable/foo-constant.html">foo</a></td>' ),
447
+ isTrue);
448
+ });
449
+ });
450
+
421
451
group ('doc references' , () {
422
452
String docsAsHtml;
423
453
@@ -1863,9 +1893,8 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
1863
1893
exLibrary.constants.firstWhere ((c) => c.name == 'deprecated' );
1864
1894
Class Dog = exLibrary.allClasses.firstWhere ((c) => c.name == 'Dog' );
1865
1895
aStaticConstField =
1866
- Dog .allFields.firstWhere ((f) => f.name == 'aStaticConstField' );
1867
- aName =
1868
- Dog .allFields.firstWhere ((f) => f.name == 'aName' );
1896
+ Dog .allFields.firstWhere ((f) => f.name == 'aStaticConstField' );
1897
+ aName = Dog .allFields.firstWhere ((f) => f.name == 'aName' );
1869
1898
});
1870
1899
1871
1900
test ('substrings of the constant values type are not linked (#1535)' , () {
@@ -1903,8 +1932,7 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
1903
1932
});
1904
1933
1905
1934
test ('MY_CAT is not linked' , () {
1906
- expect (cat.constantValue,
1907
- 'const ConstantCat('tabby')' );
1935
+ expect (cat.constantValue, 'const ConstantCat('tabby')' );
1908
1936
});
1909
1937
1910
1938
test ('exported property' , () {
@@ -1920,21 +1948,24 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
1920
1948
setUp (() {
1921
1949
apple = exLibrary.classes.firstWhere ((c) => c.name == 'Apple' );
1922
1950
constCat = exLibrary.classes.firstWhere ((c) => c.name == 'ConstantCat' );
1923
- constructorTester = fakeLibrary.classes.firstWhere ((c) => c.name == 'ConstructorTester' );
1951
+ constructorTester =
1952
+ fakeLibrary.classes.firstWhere ((c) => c.name == 'ConstructorTester' );
1924
1953
constCatConstructor = constCat.constructors[0 ];
1925
1954
appleDefaultConstructor =
1926
1955
apple.constructors.firstWhere ((c) => c.name == 'Apple' );
1927
1956
appleConstructorFromString =
1928
1957
apple.constructors.firstWhere ((c) => c.name == 'Apple.fromString' );
1929
- constructorTesterDefault =
1930
- constructorTester.constructors .firstWhere ((c) => c.name == 'ConstructorTester' );
1931
- constructorTesterFromSomething =
1932
- constructorTester.constructors .firstWhere ((c) => c.name == 'ConstructorTester.fromSomething' );
1958
+ constructorTesterDefault = constructorTester.constructors
1959
+ .firstWhere ((c) => c.name == 'ConstructorTester' );
1960
+ constructorTesterFromSomething = constructorTester.constructors
1961
+ .firstWhere ((c) => c.name == 'ConstructorTester.fromSomething' );
1933
1962
});
1934
1963
1935
1964
test ('displays generic parameters correctly' , () {
1936
- expect (constructorTesterDefault.nameWithGenerics, 'ConstructorTester<A, B>' );
1937
- expect (constructorTesterFromSomething.nameWithGenerics, 'ConstructorTester<A, B>.fromSomething' );
1965
+ expect (constructorTesterDefault.nameWithGenerics,
1966
+ 'ConstructorTester<A, B>' );
1967
+ expect (constructorTesterFromSomething.nameWithGenerics,
1968
+ 'ConstructorTester<A, B>.fromSomething' );
1938
1969
});
1939
1970
1940
1971
test ('has a fully qualified name' , () {
0 commit comments