Skip to content

Commit 5e9897d

Browse files
committed
InlineExpectationsTest: sync
1 parent 76e84ef commit 5e9897d

File tree

7 files changed

+77
-7
lines changed

7 files changed

+77
-7
lines changed

cpp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ abstract class InlineExpectationsTest extends string {
137137
final predicate hasFailureMessage(FailureLocatable element, string message) {
138138
exists(ActualResult actualResult |
139139
actualResult.getTest() = this and
140+
actualResult.getTag() = this.getARelevantTag() and
140141
element = actualResult and
141142
(
142143
exists(FalseNegativeExpectation falseNegative |
@@ -150,9 +151,18 @@ abstract class InlineExpectationsTest extends string {
150151
)
151152
)
152153
or
154+
exists(ActualResult actualResult |
155+
actualResult.getTest() = this and
156+
not actualResult.getTag() = this.getARelevantTag() and
157+
element = actualResult and
158+
message =
159+
"Tag mismatch: Actual result with tag " + actualResult.getTag() +
160+
" that is not part of getARelevantTag()"
161+
)
162+
or
153163
exists(ValidExpectation expectation |
154164
not exists(ActualResult actualResult | expectation.matchesActualResult(actualResult)) and
155-
expectation.getTag() = getARelevantTag() and
165+
expectation.getTag() = this.getARelevantTag() and
156166
element = expectation and
157167
(
158168
expectation instanceof GoodExpectation and

csharp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ abstract class InlineExpectationsTest extends string {
137137
final predicate hasFailureMessage(FailureLocatable element, string message) {
138138
exists(ActualResult actualResult |
139139
actualResult.getTest() = this and
140+
actualResult.getTag() = this.getARelevantTag() and
140141
element = actualResult and
141142
(
142143
exists(FalseNegativeExpectation falseNegative |
@@ -150,9 +151,18 @@ abstract class InlineExpectationsTest extends string {
150151
)
151152
)
152153
or
154+
exists(ActualResult actualResult |
155+
actualResult.getTest() = this and
156+
not actualResult.getTag() = this.getARelevantTag() and
157+
element = actualResult and
158+
message =
159+
"Tag mismatch: Actual result with tag " + actualResult.getTag() +
160+
" that is not part of getARelevantTag()"
161+
)
162+
or
153163
exists(ValidExpectation expectation |
154164
not exists(ActualResult actualResult | expectation.matchesActualResult(actualResult)) and
155-
expectation.getTag() = getARelevantTag() and
165+
expectation.getTag() = this.getARelevantTag() and
156166
element = expectation and
157167
(
158168
expectation instanceof GoodExpectation and

go/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ abstract class InlineExpectationsTest extends string {
137137
final predicate hasFailureMessage(FailureLocatable element, string message) {
138138
exists(ActualResult actualResult |
139139
actualResult.getTest() = this and
140+
actualResult.getTag() = this.getARelevantTag() and
140141
element = actualResult and
141142
(
142143
exists(FalseNegativeExpectation falseNegative |
@@ -150,9 +151,18 @@ abstract class InlineExpectationsTest extends string {
150151
)
151152
)
152153
or
154+
exists(ActualResult actualResult |
155+
actualResult.getTest() = this and
156+
not actualResult.getTag() = this.getARelevantTag() and
157+
element = actualResult and
158+
message =
159+
"Tag mismatch: Actual result with tag " + actualResult.getTag() +
160+
" that is not part of getARelevantTag()"
161+
)
162+
or
153163
exists(ValidExpectation expectation |
154164
not exists(ActualResult actualResult | expectation.matchesActualResult(actualResult)) and
155-
expectation.getTag() = getARelevantTag() and
165+
expectation.getTag() = this.getARelevantTag() and
156166
element = expectation and
157167
(
158168
expectation instanceof GoodExpectation and

java/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ abstract class InlineExpectationsTest extends string {
137137
final predicate hasFailureMessage(FailureLocatable element, string message) {
138138
exists(ActualResult actualResult |
139139
actualResult.getTest() = this and
140+
actualResult.getTag() = this.getARelevantTag() and
140141
element = actualResult and
141142
(
142143
exists(FalseNegativeExpectation falseNegative |
@@ -150,9 +151,18 @@ abstract class InlineExpectationsTest extends string {
150151
)
151152
)
152153
or
154+
exists(ActualResult actualResult |
155+
actualResult.getTest() = this and
156+
not actualResult.getTag() = this.getARelevantTag() and
157+
element = actualResult and
158+
message =
159+
"Tag mismatch: Actual result with tag " + actualResult.getTag() +
160+
" that is not part of getARelevantTag()"
161+
)
162+
or
153163
exists(ValidExpectation expectation |
154164
not exists(ActualResult actualResult | expectation.matchesActualResult(actualResult)) and
155-
expectation.getTag() = getARelevantTag() and
165+
expectation.getTag() = this.getARelevantTag() and
156166
element = expectation and
157167
(
158168
expectation instanceof GoodExpectation and

ql/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ abstract class InlineExpectationsTest extends string {
137137
final predicate hasFailureMessage(FailureLocatable element, string message) {
138138
exists(ActualResult actualResult |
139139
actualResult.getTest() = this and
140+
actualResult.getTag() = this.getARelevantTag() and
140141
element = actualResult and
141142
(
142143
exists(FalseNegativeExpectation falseNegative |
@@ -150,9 +151,18 @@ abstract class InlineExpectationsTest extends string {
150151
)
151152
)
152153
or
154+
exists(ActualResult actualResult |
155+
actualResult.getTest() = this and
156+
not actualResult.getTag() = this.getARelevantTag() and
157+
element = actualResult and
158+
message =
159+
"Tag mismatch: Actual result with tag " + actualResult.getTag() +
160+
" that is not part of getARelevantTag()"
161+
)
162+
or
153163
exists(ValidExpectation expectation |
154164
not exists(ActualResult actualResult | expectation.matchesActualResult(actualResult)) and
155-
expectation.getTag() = getARelevantTag() and
165+
expectation.getTag() = this.getARelevantTag() and
156166
element = expectation and
157167
(
158168
expectation instanceof GoodExpectation and

ruby/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ abstract class InlineExpectationsTest extends string {
137137
final predicate hasFailureMessage(FailureLocatable element, string message) {
138138
exists(ActualResult actualResult |
139139
actualResult.getTest() = this and
140+
actualResult.getTag() = this.getARelevantTag() and
140141
element = actualResult and
141142
(
142143
exists(FalseNegativeExpectation falseNegative |
@@ -150,9 +151,18 @@ abstract class InlineExpectationsTest extends string {
150151
)
151152
)
152153
or
154+
exists(ActualResult actualResult |
155+
actualResult.getTest() = this and
156+
not actualResult.getTag() = this.getARelevantTag() and
157+
element = actualResult and
158+
message =
159+
"Tag mismatch: Actual result with tag " + actualResult.getTag() +
160+
" that is not part of getARelevantTag()"
161+
)
162+
or
153163
exists(ValidExpectation expectation |
154164
not exists(ActualResult actualResult | expectation.matchesActualResult(actualResult)) and
155-
expectation.getTag() = getARelevantTag() and
165+
expectation.getTag() = this.getARelevantTag() and
156166
element = expectation and
157167
(
158168
expectation instanceof GoodExpectation and

swift/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ abstract class InlineExpectationsTest extends string {
137137
final predicate hasFailureMessage(FailureLocatable element, string message) {
138138
exists(ActualResult actualResult |
139139
actualResult.getTest() = this and
140+
actualResult.getTag() = this.getARelevantTag() and
140141
element = actualResult and
141142
(
142143
exists(FalseNegativeExpectation falseNegative |
@@ -150,9 +151,18 @@ abstract class InlineExpectationsTest extends string {
150151
)
151152
)
152153
or
154+
exists(ActualResult actualResult |
155+
actualResult.getTest() = this and
156+
not actualResult.getTag() = this.getARelevantTag() and
157+
element = actualResult and
158+
message =
159+
"Tag mismatch: Actual result with tag " + actualResult.getTag() +
160+
" that is not part of getARelevantTag()"
161+
)
162+
or
153163
exists(ValidExpectation expectation |
154164
not exists(ActualResult actualResult | expectation.matchesActualResult(actualResult)) and
155-
expectation.getTag() = getARelevantTag() and
165+
expectation.getTag() = this.getARelevantTag() and
156166
element = expectation and
157167
(
158168
expectation instanceof GoodExpectation and

0 commit comments

Comments
 (0)