OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 | 122 |
123 public void test_functionTypeAlias_summary() throws Exception { | 123 public void test_functionTypeAlias_summary() throws Exception { |
124 AstNode id = findNodeIn("FFF", createSource(// | 124 AstNode id = findNodeIn("FFF", createSource(// |
125 "/// My function type", | 125 "/// My function type", |
126 "typedef int FFF(int a, double b);")); | 126 "typedef int FFF(int a, double b);")); |
127 Element element = ElementLocator.locate(id); | 127 Element element = ElementLocator.locate(id); |
128 assertEquals("int FFF(int a, double b)", DartDocUtilities.getTextSummary(nul
l, element)); | 128 assertEquals("int FFF(int a, double b)", DartDocUtilities.getTextSummary(nul
l, element)); |
129 } | 129 } |
130 | 130 |
| 131 /** |
| 132 * <p> |
| 133 * https://code.google.com/p/dart/issues/detail?id=18438 |
| 134 */ |
| 135 public void test_getDartDocAsHtml_codeSample_index() throws Exception { |
| 136 AstNode id = findNodeIn("A", createSource(// |
| 137 "/// Example:", |
| 138 "/// var x = values[0];", |
| 139 "/// var y = values[1];", |
| 140 "class A { }")); |
| 141 Element element = ElementLocator.locate(id); |
| 142 assertEquals("Example:\n" + "<pre> var x = values[0];</pre><pre>\n" |
| 143 + " var y = values[1];</pre>", DartDocUtilities.getDartDocAsHtml(elem
ent)); |
| 144 } |
| 145 |
131 public void test_method_doc() throws Exception { | 146 public void test_method_doc() throws Exception { |
132 AstNode id = findNodeIn("x", createSource(// | 147 AstNode id = findNodeIn("x", createSource(// |
133 "/// My method", | 148 "/// My method", |
134 "int x() => 42;")); | 149 "int x() => 42;")); |
135 Element element = ElementLocator.locate(id); | 150 Element element = ElementLocator.locate(id); |
136 assertEquals("My method\n", DartDocUtilities.getDartDocAsHtml(element)); | 151 assertEquals("My method\n", DartDocUtilities.getDartDocAsHtml(element)); |
137 } | 152 } |
138 | 153 |
139 public void test_method_named_doc() throws Exception { | 154 public void test_method_named_doc() throws Exception { |
140 AstNode id = findNodeIn("x", "void x({String named}) {}"); | 155 AstNode id = findNodeIn("x", "void x({String named}) {}"); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 } | 263 } |
249 | 264 |
250 private CompilationUnit resolve(String... lines) throws Exception { | 265 private CompilationUnit resolve(String... lines) throws Exception { |
251 Source source = addSource(createSource(lines)); | 266 Source source = addSource(createSource(lines)); |
252 LibraryElement library = resolve(source); | 267 LibraryElement library = resolve(source); |
253 assertNoErrors(source); | 268 assertNoErrors(source); |
254 verify(source); | 269 verify(source); |
255 return getAnalysisContext().resolveCompilationUnit(source, library); | 270 return getAnalysisContext().resolveCompilationUnit(source, library); |
256 } | 271 } |
257 } | 272 } |
OLD | NEW |