-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathminimal_test.rs
More file actions
36 lines (32 loc) · 1.11 KB
/
Copy pathminimal_test.rs
File metadata and controls
36 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// This is a minimal test script to verify the VulnerabilityType structure
// without running a full cargo test
// Define the same structure as in the project
#[derive(Debug, PartialEq)]
enum VulnerabilityType {
CrossContractReentrancy {
details: String,
},
Reentrancy {
function_signature: String,
},
// Other variants omitted for brevity
}
fn main() {
// Create a CrossContractReentrancy instance
let vuln = VulnerabilityType::CrossContractReentrancy {
details: "Cross-contract reentrancy between multiple contracts detected".to_string()
};
// Verify it matches the expected pattern
match vuln {
VulnerabilityType::CrossContractReentrancy { details } => {
println!("✅ CrossContractReentrancy structure is correct");
println!("Details: {}", details);
assert!(details.contains("Cross-contract reentrancy"), "Details should contain the expected text");
},
_ => {
println!("❌ Unexpected variant");
std::process::exit(1);
}
}
println!("All tests passed!");
}