Skip to content

Commit c53e529

Browse files
committed
Ruby: Update remaining inline expectation tests to use the paramterized module
1 parent d6d21e3 commit c53e529

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

ruby/ql/test/TestUtilities/InlineTypeTrackingFlowTest.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ DataFlow::LocalSourceNode track(DataFlow::CallNode source) {
1515
result = track(TypeTracker::end(), source)
1616
}
1717

18-
class TypeTrackingFlowTest extends InlineExpectationsTest {
19-
TypeTrackingFlowTest() { this = "TypeTrackingFlowTest" }
18+
module TypeTrackingFlowTest implements TestSig {
19+
string getARelevantTag() { result = "hasValueFlow" }
2020

21-
override string getARelevantTag() { result = "hasValueFlow" }
22-
23-
override predicate hasActualResult(Location location, string element, string tag, string value) {
21+
predicate hasActualResult(Location location, string element, string tag, string value) {
2422
exists(DataFlow::Node sink, DataFlow::Node source |
2523
defaultSink(sink) and
2624
track(source).flowsTo(sink) and
@@ -31,3 +29,5 @@ class TypeTrackingFlowTest extends InlineExpectationsTest {
3129
)
3230
}
3331
}
32+
33+
import MakeTest<TypeTrackingFlowTest>

ruby/ql/test/library-tests/dataflow/array-flow/type-tracking-array-flow.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
failures
2+
testFailures
13
| array_flow.rb:107:10:107:13 | ...[...] | Unexpected result: hasValueFlow=11.2 |
24
| array_flow.rb:179:28:179:46 | # $ hasValueFlow=19 | Missing result:hasValueFlow=19 |
35
| array_flow.rb:180:28:180:46 | # $ hasValueFlow=19 | Missing result:hasValueFlow=19 |

ruby/ql/test/library-tests/dataflow/global/TypeTrackingInlineTest.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
failures
2+
testFailures
13
| captured_variables.rb:9:14:9:14 | x | Fixed missing result:hasValueFlow=1.2 |
24
| captured_variables.rb:16:14:16:14 | x | Fixed missing result:hasValueFlow=1.3 |
35
| instance_variables.rb:20:16:20:33 | # $ hasValueFlow=7 | Missing result:hasValueFlow=7 |

ruby/ql/test/library-tests/dataflow/hash-flow/type-tracking-hash-flow.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
failures
2+
testFailures
13
| hash_flow.rb:65:21:65:40 | # $ hasValueFlow=3.3 | Missing result:hasValueFlow=3.3 |
24
| hash_flow.rb:66:21:66:49 | # $ SPURIOUS hasValueFlow=3.3 | Missing result:hasValueFlow=3.3 |
35
| hash_flow.rb:114:10:114:17 | ...[...] | Unexpected result: hasValueFlow=7.2 |

0 commit comments

Comments
 (0)