refuse a dependency add of an issue on itself
This commit is contained in:
parent
8895bfc63f
commit
a70b25847e
1 changed files with 19 additions and 0 deletions
|
|
@ -149,3 +149,17 @@ fn non_cyclic_add_reaches_the_forge() {
|
|||
fn tag(n: u64) -> String {
|
||||
format!("{}{n}", '#')
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn self_dependency_is_refused_before_any_post() {
|
||||
let (ok, stderr, posts) = add("self", "10", "10");
|
||||
assert!(!ok);
|
||||
assert!(
|
||||
stderr.contains(&format!(
|
||||
"{} cannot depend on itself, which would create a cycle",
|
||||
tag(10)
|
||||
)),
|
||||
"{stderr}"
|
||||
);
|
||||
assert_eq!(posts, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue