OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 } | 1398 } |
1399 class D { | 1399 class D { |
1400 } | 1400 } |
1401 class E { | 1401 class E { |
1402 } | 1402 } |
1403 '''); | 1403 '''); |
1404 } | 1404 } |
1405 | 1405 |
1406 test_class_alias_documented() async { | 1406 test_class_alias_documented() async { |
1407 var library = await checkLibrary(''' | 1407 var library = await checkLibrary(''' |
| 1408 /** |
| 1409 * Docs |
| 1410 */ |
| 1411 class C = D with E; |
| 1412 |
| 1413 class D {} |
| 1414 class E {} |
| 1415 '''); |
| 1416 checkElementText(library, r''' |
| 1417 /** |
| 1418 * Docs |
| 1419 */ |
| 1420 class alias C extends D with E { |
| 1421 synthetic C() = D; |
| 1422 } |
| 1423 class D { |
| 1424 } |
| 1425 class E { |
| 1426 } |
| 1427 '''); |
| 1428 } |
| 1429 |
| 1430 test_class_alias_documented_tripleSlash() async { |
| 1431 var library = await checkLibrary(''' |
| 1432 /// aaa |
| 1433 /// b |
| 1434 /// cc |
| 1435 class C = D with E; |
| 1436 |
| 1437 class D {} |
| 1438 class E {} |
| 1439 '''); |
| 1440 checkElementText(library, r''' |
| 1441 /// aaa |
| 1442 /// b |
| 1443 /// cc |
| 1444 class alias C extends D with E { |
| 1445 synthetic C() = D; |
| 1446 } |
| 1447 class D { |
| 1448 } |
| 1449 class E { |
| 1450 } |
| 1451 '''); |
| 1452 } |
| 1453 |
| 1454 test_class_alias_documented_withLeadingNonDocumentation() async { |
| 1455 var library = await checkLibrary(''' |
1408 // Extra comment so doc comment offset != 0 | 1456 // Extra comment so doc comment offset != 0 |
1409 /** | 1457 /** |
1410 * Docs | 1458 * Docs |
1411 */ | 1459 */ |
1412 class C = D with E; | 1460 class C = D with E; |
1413 | 1461 |
1414 class D {} | 1462 class D {} |
1415 class E {}'''); | 1463 class E {}'''); |
1416 checkElementText(library, r''' | 1464 checkElementText(library, r''' |
1417 /** | 1465 /** |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 class C {}'''); | 1855 class C {}'''); |
1808 checkElementText(library, r''' | 1856 checkElementText(library, r''' |
1809 /** | 1857 /** |
1810 * Docs | 1858 * Docs |
1811 */ | 1859 */ |
1812 class C { | 1860 class C { |
1813 } | 1861 } |
1814 '''); | 1862 '''); |
1815 } | 1863 } |
1816 | 1864 |
| 1865 test_class_documented_mix() async { |
| 1866 var library = await checkLibrary(''' |
| 1867 /** |
| 1868 * aaa |
| 1869 */ |
| 1870 /** |
| 1871 * bbb |
| 1872 */ |
| 1873 class A {} |
| 1874 |
| 1875 /** |
| 1876 * aaa |
| 1877 */ |
| 1878 /// bbb |
| 1879 /// ccc |
| 1880 class B {} |
| 1881 |
| 1882 /// aaa |
| 1883 /// bbb |
| 1884 /** |
| 1885 * ccc |
| 1886 */ |
| 1887 class C {} |
| 1888 |
| 1889 /// aaa |
| 1890 /// bbb |
| 1891 /** |
| 1892 * ccc |
| 1893 */ |
| 1894 /// ddd |
| 1895 class D {} |
| 1896 |
| 1897 /** |
| 1898 * aaa |
| 1899 */ |
| 1900 // bbb |
| 1901 class E {} |
| 1902 '''); |
| 1903 checkElementText(library, r''' |
| 1904 /** |
| 1905 * bbb |
| 1906 */ |
| 1907 class A { |
| 1908 } |
| 1909 /// bbb |
| 1910 /// ccc |
| 1911 class B { |
| 1912 } |
| 1913 /** |
| 1914 * ccc |
| 1915 */ |
| 1916 class C { |
| 1917 } |
| 1918 /// ddd |
| 1919 class D { |
| 1920 } |
| 1921 /** |
| 1922 * aaa |
| 1923 */ |
| 1924 class E { |
| 1925 } |
| 1926 '''); |
| 1927 } |
| 1928 |
1817 test_class_documented_tripleSlash() async { | 1929 test_class_documented_tripleSlash() async { |
1818 var library = await checkLibrary(''' | 1930 var library = await checkLibrary(''' |
1819 /// aaa | 1931 /// aaa |
1820 /// bbbb | 1932 /// bbbb |
1821 /// cc | 1933 /// cc |
1822 class C {}'''); | 1934 class C {}'''); |
1823 checkElementText(library, r''' | 1935 checkElementText(library, r''' |
1824 /// aaa | 1936 /// aaa |
1825 /// bbbb | 1937 /// bbbb |
1826 /// cc | 1938 /// cc |
(...skipping 8029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9856 fail('Unexpectedly tried to get unlinked summary for $uri'); | 9968 fail('Unexpectedly tried to get unlinked summary for $uri'); |
9857 } | 9969 } |
9858 return serializedUnit; | 9970 return serializedUnit; |
9859 } | 9971 } |
9860 | 9972 |
9861 @override | 9973 @override |
9862 bool hasLibrarySummary(String uri) { | 9974 bool hasLibrarySummary(String uri) { |
9863 return true; | 9975 return true; |
9864 } | 9976 } |
9865 } | 9977 } |
OLD | NEW |