Skip to content

Add a test for getter doc inheritance when overridden by variable. #1781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/model_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,12 @@ void main() {
expect(localMethod.documentationAsHtml, contains('<code>bar</code>'));
});

test('doc comment inherited from getter', () {
Field getterWithDocs = subForDocComments.instanceProperties
.firstWhere((m) => m.name == 'getterWithDocs');
expect(getterWithDocs.documentationAsHtml, contains('Some really great topics.'));
});

test(
'a property with no explicit getters and setters does not duplicate docs',
() {
Expand Down
6 changes: 6 additions & 0 deletions testing/test_package/lib/fake.dart
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,9 @@ class BaseForDocComments {

void anotherMethod() {}

/// Some really great topics.
bool get getterWithDocs => true;

String operator [](String key) => "${key}'s value";
}

Expand All @@ -847,6 +850,9 @@ class BaseForDocComments {
class SubForDocComments extends BaseForDocComments {
/// Reference to [foo] and [bar]
void localMethod(String foo, bar) {}

@override
final bool getterWithDocs = false;
}

typedef void VoidCallback();
Expand Down
13 changes: 11 additions & 2 deletions testing/test_package_docs/fake/BaseForDocComments-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,18 @@ <h2>Constructors</h2>
</dl>
</section>

<section class="summary offset-anchor inherited" id="instance-properties">
<section class="summary offset-anchor" id="instance-properties">
<h2>Properties</h2>

<dl class="properties">
<dt id="getterWithDocs" class="property">
<span class="name"><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></span>
<span class="signature">&#8594; bool</span>
</dt>
<dd>
Some really great topics.
<div class="features">read-only</div>
</dd>
<dt id="hashCode" class="property inherited">
<span class="name"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></span>
<span class="signature">&#8594; int</span>
Expand Down Expand Up @@ -302,9 +310,10 @@ <h2>Operators</h2>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
108 changes: 108 additions & 0 deletions testing/test_package_docs/fake/BaseForDocComments/getterWithDocs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="API docs for the getterWithDocs property from the BaseForDocComments class, for the Dart programming language.">
<title>getterWithDocs property - BaseForDocComments class - fake library - Dart API</title>
<!-- required because all the links are pseudo-absolute -->
<base href="../..">

<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
<link rel="stylesheet" href="static-assets/github.css">
<link rel="stylesheet" href="static-assets/styles.css">
<link rel="icon" href="static-assets/favicon.png">

</head>

<body>

<div id="overlay-under-drawer"></div>

<header id="title">
<button id="sidenav-left-toggle" type="button">&nbsp;</button>
<ol class="breadcrumbs gt-separated dark hidden-xs">
<li><a href="index.html">test_package</a></li>
<li><a href="fake/fake-library.html">fake</a></li>
<li><a href="fake/BaseForDocComments-class.html">BaseForDocComments</a></li>
<li class="self-crumb">getterWithDocs property</li>
</ol>
<div class="self-name">getterWithDocs</div>
<form class="search navbar-right" role="search">
<input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
</form>
</header>

<main>

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
<h5>BaseForDocComments class</h5>
<ol>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

<li class="section-title"><a href="fake/BaseForDocComments-class.html#instance-methods">Methods</a></li>
<li><a href="fake/BaseForDocComments/anotherMethod.html">anotherMethod</a></li>
<li><a href="fake/BaseForDocComments/doAwesomeStuff.html">doAwesomeStuff</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/noSuchMethod.html">noSuchMethod</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/toString.html">toString</a></li>

<li class="section-title"><a href="fake/BaseForDocComments-class.html#operators">Operators</a></li>
<li><a href="fake/BaseForDocComments/operator_get.html">operator []</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/operator_equals.html">operator ==</a></li>



</ol>
</div><!--/.sidebar-offcanvas-->

<div class="col-xs-12 col-sm-9 col-md-8 main-content">
<h1>getterWithDocs property</h1>


<section id="getter">

<section class="multi-line-signature">
<span class="returntype">bool</span>
<span class="name ">getterWithDocs</span>

</section>

<section class="desc markdown">
<p>Some really great topics.</p>
</section>

</section>

</div> <!-- /.main-content -->

<div class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
</div><!--/.sidebar-offcanvas-->

</main>

<footer>
<span class="no-break">
test_package 0.0.1
</span>

</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>


</body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>BaseForDocComments class</h5>
<li class="section-title"><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments/BaseForDocComments.html">BaseForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/BaseForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
13 changes: 11 additions & 2 deletions testing/test_package_docs/fake/SubForDocComments-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,18 @@ <h2>Constructors</h2>
</dl>
</section>

<section class="summary offset-anchor inherited" id="instance-properties">
<section class="summary offset-anchor" id="instance-properties">
<h2>Properties</h2>

<dl class="properties">
<dt id="getterWithDocs" class="property">
<span class="name"><a href="fake/SubForDocComments/getterWithDocs.html">getterWithDocs</a></span>
<span class="signature">&#8594; bool</span>
</dt>
<dd>
Some really great topics.
<div class="features">final</div>
</dd>
<dt id="hashCode" class="property inherited">
<span class="name"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></span>
<span class="signature">&#8594; int</span>
Expand Down Expand Up @@ -311,9 +319,10 @@ <h2>Operators</h2>
<li class="section-title"><a href="fake/SubForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/SubForDocComments/SubForDocComments.html">SubForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/SubForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/SubForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ <h5>SubForDocComments class</h5>
<li class="section-title"><a href="fake/SubForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/SubForDocComments/SubForDocComments.html">SubForDocComments</a></li>

<li class="section-title inherited">
<li class="section-title">
<a href="fake/SubForDocComments-class.html#instance-properties">Properties</a>
</li>
<li><a href="fake/SubForDocComments/getterWithDocs.html">getterWithDocs</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/hashCode.html">hashCode</a></li>
<li class="inherited"><a href="fake/BaseForDocComments/runtimeType.html">runtimeType</a></li>

Expand Down
Loading