|
4 | 4 | * (in that the `.expected` file should always be empty). |
5 | 5 | * |
6 | 6 | * To add this framework to a new language: |
7 | | - * - Add a file `InlineExpectationsTestPrivate.qll` that defines a `LineComment` class. This class |
| 7 | + * - Add a file `InlineExpectationsTestPrivate.qll` that defines a `ExpectationComment` class. This class |
8 | 8 | * must support a `getContents` method that returns the contents of the given comment, _excluding_ |
9 | 9 | * the comment indicator itself. It should also define `toString` and `getLocation` as usual. |
10 | 10 | * |
@@ -194,7 +194,7 @@ private int getEndOfColumnPosition(int start, string content) { |
194 | 194 | } |
195 | 195 |
|
196 | 196 | private predicate getAnExpectation( |
197 | | - LineComment comment, TColumn column, string expectation, string tags, string value |
| 197 | + ExpectationComment comment, TColumn column, string expectation, string tags, string value |
198 | 198 | ) { |
199 | 199 | exists(string content | |
200 | 200 | content = comment.getContents().regexpCapture(expectationCommentPattern(), 1) and |
@@ -247,14 +247,14 @@ private newtype TFailureLocatable = |
247 | 247 | ) { |
248 | 248 | test.hasActualResult(location, element, tag, value) |
249 | 249 | } or |
250 | | - TValidExpectation(LineComment comment, string tag, string value, string knownFailure) { |
| 250 | + TValidExpectation(ExpectationComment comment, string tag, string value, string knownFailure) { |
251 | 251 | exists(TColumn column, string tags | |
252 | 252 | getAnExpectation(comment, column, _, tags, value) and |
253 | 253 | tag = tags.splitAt(",") and |
254 | 254 | knownFailure = getColumnString(column) |
255 | 255 | ) |
256 | 256 | } or |
257 | | - TInvalidExpectation(LineComment comment, string expectation) { |
| 257 | + TInvalidExpectation(ExpectationComment comment, string expectation) { |
258 | 258 | getAnExpectation(comment, _, expectation, _, _) and |
259 | 259 | not expectation.regexpMatch(expectationPattern()) |
260 | 260 | } |
@@ -292,7 +292,7 @@ class ActualResult extends FailureLocatable, TActualResult { |
292 | 292 | } |
293 | 293 |
|
294 | 294 | abstract private class Expectation extends FailureLocatable { |
295 | | - LineComment comment; |
| 295 | + ExpectationComment comment; |
296 | 296 |
|
297 | 297 | override string toString() { result = comment.toString() } |
298 | 298 |
|
|
0 commit comments