Skip to content

Commit d78f445

Browse files
committed
Add new test-case to reproduce gix-url failure in debug mode only (#1082)
1 parent d3fb537 commit d78f445

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wss:// @ 󠄷 񠀷 󠀷 󠀷 󠀷 󠀷 󠀷 󠀷 󠀷 󠀷 󠀷 󠀷 󠀷 󠀷 󠀷 ㏴ ㅴ ㏴ 㩴 ㅴ ㏴ ㅴ . /

gix-url/tests/fuzzed.rs

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@ use bstr::ByteSlice;
22
use std::path::Path;
33
use std::time::Duration;
44

5+
#[test]
6+
#[cfg_attr(debug_assertions, ignore = "fails due to integer overflow")]
7+
fn abort_unfixed_in_debug_mode() {
8+
let name = "very-long-abort";
9+
let base = Path::new("tests").join("fixtures").join("fuzzed");
10+
let location = base.join(Path::new(name).with_extension("url"));
11+
let url = std::fs::read(&location).unwrap();
12+
let start = std::time::Instant::now();
13+
gix_url::parse(url.as_bstr()).ok();
14+
assert!(
15+
start.elapsed() < Duration::from_millis(100),
16+
"URL at '{}' parsed too slowly, took {:.00}s",
17+
location.display(),
18+
start.elapsed().as_secs_f32()
19+
);
20+
}
21+
522
#[test]
623
fn fuzzed() {
724
for name in [

0 commit comments

Comments
 (0)