Ruby: Update remaining inline expectation tests to use the paramterized module

This commit is contained in:
Jeroen Ketema
2023-06-15 16:44:19 +02:00
parent d6d21e3928
commit c53e529bac
4 changed files with 11 additions and 5 deletions

View File

@@ -15,12 +15,10 @@ DataFlow::LocalSourceNode track(DataFlow::CallNode source) {
result = track(TypeTracker::end(), source)
}
class TypeTrackingFlowTest extends InlineExpectationsTest {
TypeTrackingFlowTest() { this = "TypeTrackingFlowTest" }
module TypeTrackingFlowTest implements TestSig {
string getARelevantTag() { result = "hasValueFlow" }
override string getARelevantTag() { result = "hasValueFlow" }
override predicate hasActualResult(Location location, string element, string tag, string value) {
predicate hasActualResult(Location location, string element, string tag, string value) {
exists(DataFlow::Node sink, DataFlow::Node source |
defaultSink(sink) and
track(source).flowsTo(sink) and
@@ -31,3 +29,5 @@ class TypeTrackingFlowTest extends InlineExpectationsTest {
)
}
}
import MakeTest<TypeTrackingFlowTest>

View File

@@ -1,3 +1,5 @@
failures
testFailures
| array_flow.rb:107:10:107:13 | ...[...] | Unexpected result: hasValueFlow=11.2 |
| array_flow.rb:179:28:179:46 | # $ hasValueFlow=19 | Missing result:hasValueFlow=19 |
| array_flow.rb:180:28:180:46 | # $ hasValueFlow=19 | Missing result:hasValueFlow=19 |

View File

@@ -1,3 +1,5 @@
failures
testFailures
| captured_variables.rb:9:14:9:14 | x | Fixed missing result:hasValueFlow=1.2 |
| captured_variables.rb:16:14:16:14 | x | Fixed missing result:hasValueFlow=1.3 |
| instance_variables.rb:20:16:20:33 | # $ hasValueFlow=7 | Missing result:hasValueFlow=7 |

View File

@@ -1,3 +1,5 @@
failures
testFailures
| hash_flow.rb:65:21:65:40 | # $ hasValueFlow=3.3 | Missing result:hasValueFlow=3.3 |
| hash_flow.rb:66:21:66:49 | # $ SPURIOUS hasValueFlow=3.3 | Missing result:hasValueFlow=3.3 |
| hash_flow.rb:114:10:114:17 | ...[...] | Unexpected result: hasValueFlow=7.2 |