Skip to content

Commit 7cf872b

Browse files
committed
Rust: Adjust the tests to work around test processing of /.
1 parent 23ac35e commit 7cf872b

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
| test.rs:61:10:61:23 | remote_string1 | Unexpected result: hasTaintFlow="http://example.com/" |
2-
| test.rs:64:10:64:23 | remote_string2 | Unexpected result: hasTaintFlow="http://example.com/" |
3-
| test.rs:67:10:67:23 | remote_string3 | Unexpected result: hasTaintFlow="http://example.com/" |
4-
| test.rs:70:10:70:23 | remote_string4 | Unexpected result: hasTaintFlow="http://example.com/" |

rust/ql/test/library-tests/dataflow/sources/test.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,25 @@ fn test_env_dirs() {
5757
}
5858

5959
async fn test_reqwest() -> Result<(), reqwest::Error> {
60-
let remote_string1 = reqwest::blocking::get("http://example.com/")?.text()?; // $ Alert[rust/summary/taint-sources]
61-
sink(remote_string1); // $ MISSING: hasTaintFlow
60+
let remote_string1 = reqwest::blocking::get("example.com")?.text()?; // $ Alert[rust/summary/taint-sources]
61+
sink(remote_string1); // $ hasTaintFlow="example.com"
6262

63-
let remote_string2 = reqwest::blocking::get("http://example.com/").unwrap().text().unwrap(); // $ Alert[rust/summary/taint-sources]
64-
sink(remote_string2); // $ MISSING: hasTaintFlow
63+
let remote_string2 = reqwest::blocking::get("example.com").unwrap().text().unwrap(); // $ Alert[rust/summary/taint-sources]
64+
sink(remote_string2); // $ hasTaintFlow="example.com"
6565

66-
let remote_string3 = reqwest::blocking::get("http://example.com/").unwrap().text_with_charset("utf-8").unwrap(); // $ Alert[rust/summary/taint-sources]
67-
sink(remote_string3); // $ MISSING: hasTaintFlow
66+
let remote_string3 = reqwest::blocking::get("example.com").unwrap().text_with_charset("utf-8").unwrap(); // $ Alert[rust/summary/taint-sources]
67+
sink(remote_string3); // $ hasTaintFlow="example.com"
6868

69-
let remote_string4 = reqwest::blocking::get("http://example.com/").unwrap().bytes().unwrap(); // $ Alert[rust/summary/taint-sources]
70-
sink(remote_string4); // $ MISSING: hasTaintFlow
69+
let remote_string4 = reqwest::blocking::get("example.com").unwrap().bytes().unwrap(); // $ Alert[rust/summary/taint-sources]
70+
sink(remote_string4); // $ hasTaintFlow="example.com"
7171

72-
let remote_string5 = reqwest::get("http://example.com/").await?.text().await?; // $ Alert[rust/summary/taint-sources]
72+
let remote_string5 = reqwest::get("example.com").await?.text().await?; // $ Alert[rust/summary/taint-sources]
7373
sink(remote_string5); // $ MISSING: hasTaintFlow
7474

75-
let remote_string6 = reqwest::get("http://example.com/").await?.bytes().await?; // $ Alert[rust/summary/taint-sources]
75+
let remote_string6 = reqwest::get("example.com").await?.bytes().await?; // $ Alert[rust/summary/taint-sources]
7676
sink(remote_string6); // $ MISSING: hasTaintFlow
7777

78-
let mut request1 = reqwest::get("http://example.com/").await?; // $ Alert[rust/summary/taint-sources]
78+
let mut request1 = reqwest::get("example.com").await?; // $ Alert[rust/summary/taint-sources]
7979
while let Some(chunk) = request1.chunk().await? {
8080
sink(chunk); // $ MISSING: hasTaintFlow
8181
}

0 commit comments

Comments
 (0)