Skip to content

Commit 36a63f5

Browse files
committed
add a test for invalid patch url
1 parent 1d2968d commit 36a63f5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/toolchain.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,13 @@ mod tests {
363363
assert!(Toolchain::from_str("stable+rustdocflags=").is_err());
364364
assert!(Toolchain::from_str("stable+donotusethisflag=ever").is_err());
365365
assert!(Toolchain::from_str("stable+patch=").is_err());
366+
assert!(matches!(
367+
Toolchain::from_str(
368+
"stable+patch=getrandom=git@github.com:rust-random/getrandom=backports/v0.2"
369+
)
370+
.unwrap_err(),
371+
super::ToolchainParseError::InvalidUrl(..)
372+
));
366373
assert!(Toolchain::from_str("try#1234+target=").is_err());
367374
assert!(Toolchain::from_str("0000000000000000000000000000000000000000").is_err());
368375
}

0 commit comments

Comments
 (0)