27 lines
713 B
Rust
27 lines
713 B
Rust
//! 测试文件:包含宪法约束违规的代码
|
||
|
||
// 违规1:硬编码宪法参数
|
||
fn test_hardcoded_param() {
|
||
let dt_min = 100; // ❌ 应该使用 constitutional_state::CBPP_DT_MIN
|
||
println!("dt_min: {}", dt_min);
|
||
}
|
||
|
||
// 违规2:硬编码时间常量
|
||
fn test_hardcoded_time() {
|
||
let max_wait = 2592000; // ❌ 应该使用 constitutional_state::MAX_WAIT_TIME
|
||
println!("max_wait: {}", max_wait);
|
||
}
|
||
|
||
// 正确:使用宪法常量
|
||
fn test_correct_usage() {
|
||
// 假设有constitutional_state模块
|
||
// let dt_min = constitutional_state::CBPP_DT_MIN;
|
||
// println!("dt_min: {}", dt_min);
|
||
}
|
||
|
||
fn main() {
|
||
test_hardcoded_param();
|
||
test_hardcoded_time();
|
||
test_correct_usage();
|
||
}
|