use adze_runtime_governance_api::{
BddGovernanceSnapshot, BddPhase, BddScenario, BddScenarioStatus, GLR_CONFLICT_FALLBACK,
GLR_CONFLICT_PRESERVATION_GRID, ParserBackend, bdd_governance_matrix_for_current_profile,
bdd_governance_matrix_for_profile, bdd_governance_matrix_for_runtime,
bdd_governance_matrix_for_runtime2, bdd_governance_matrix_for_runtime2_profile,
bdd_governance_snapshot, bdd_progress, bdd_progress_report,
bdd_progress_report_for_current_profile, bdd_progress_report_with_profile,
bdd_progress_report_with_profile_runtime, bdd_progress_status_line,
bdd_status_line_for_current_profile, current_backend_for, describe_backend_for_conflicts,
parser_feature_profile_for_runtime, resolve_backend_for_profile, runtime_governance_snapshot,
};
#[test]
fn test_contract_lock_types() {
let _core = BddPhase::Core;
let _runtime = BddPhase::Runtime;
let _tree_sitter = ParserBackend::TreeSitter;
let _pure_rust = ParserBackend::PureRust;
let _glr = ParserBackend::GLR;
let _profile = parser_feature_profile_for_runtime();
let _scenario = BddScenario {
id: 0,
title: "test scenario",
reference: "test reference",
core_status: BddScenarioStatus::Implemented,
runtime_status: BddScenarioStatus::Implemented,
};
let _snapshot = BddGovernanceSnapshot {
phase: BddPhase::Core,
implemented: 0,
total: 0,
profile: parser_feature_profile_for_runtime(),
};
}
#[test]
fn test_contract_lock_constants() {
let grid = GLR_CONFLICT_PRESERVATION_GRID;
assert!(!grid.is_empty());
let fallback = GLR_CONFLICT_FALLBACK;
assert!(!fallback.is_empty());
}
#[test]
fn test_contract_lock_functions() {
let profile = parser_feature_profile_for_runtime();
let _backend = current_backend_for(false);
let _profile = parser_feature_profile_for_runtime();
let _backend = resolve_backend_for_profile(profile, false);
let _desc = describe_backend_for_conflicts(profile);
assert!(!_desc.is_empty());
let (_implemented, _total) = bdd_progress(BddPhase::Core, GLR_CONFLICT_PRESERVATION_GRID);
let _report = bdd_progress_report(BddPhase::Core, GLR_CONFLICT_PRESERVATION_GRID, "Test");
assert!(_report.contains("Test"));
let _report = bdd_progress_report_with_profile(
BddPhase::Core,
GLR_CONFLICT_PRESERVATION_GRID,
"Test",
profile,
);
let _report = bdd_progress_report_with_profile_runtime(
BddPhase::Core,
GLR_CONFLICT_PRESERVATION_GRID,
"Test",
profile,
);
let _status = bdd_progress_status_line(BddPhase::Core, GLR_CONFLICT_PRESERVATION_GRID, profile);
}
#[test]
fn test_contract_lock_current_profile_functions() {
let _report = bdd_progress_report_for_current_profile(BddPhase::Core, "Core");
assert!(_report.contains("Core"));
let _status = bdd_status_line_for_current_profile(BddPhase::Runtime);
assert!(_status.starts_with("runtime:"));
}
#[test]
fn test_contract_lock_matrix_functions() {
let profile = parser_feature_profile_for_runtime();
let _matrix = bdd_governance_matrix_for_current_profile(BddPhase::Core);
let _matrix = bdd_governance_matrix_for_profile(BddPhase::Core, profile);
let _matrix = bdd_governance_matrix_for_runtime();
let _matrix = bdd_governance_matrix_for_runtime2(BddPhase::Core, profile.glr);
let _matrix = bdd_governance_matrix_for_runtime2_profile(BddPhase::Core, profile.glr);
}
#[test]
fn test_contract_lock_snapshot_functions() {
let profile = parser_feature_profile_for_runtime();
let _snapshot =
bdd_governance_snapshot(BddPhase::Core, GLR_CONFLICT_PRESERVATION_GRID, profile);
let snapshot = runtime_governance_snapshot(BddPhase::Core);
assert_eq!(snapshot.phase, BddPhase::Core);
}
#[test]
fn test_contract_lock_backend_methods() {
let name: &'static str = ParserBackend::TreeSitter.name();
assert!(!name.is_empty());
assert!(ParserBackend::GLR.is_glr());
assert!(!ParserBackend::TreeSitter.is_glr());
assert!(ParserBackend::PureRust.is_pure_rust());
assert!(!ParserBackend::TreeSitter.is_pure_rust());
let _backend = ParserBackend::select(false);
}
#[test]
fn test_contract_lock_profile_methods() {
let profile = parser_feature_profile_for_runtime();
let _backend = profile.resolve_backend(false);
let _has = profile.has_pure_rust();
let _has = profile.has_glr();
let _has = profile.has_tree_sitter();
}
#[test]
fn test_contract_lock_snapshot_methods() {
let snapshot = BddGovernanceSnapshot {
phase: BddPhase::Core,
implemented: 5,
total: 5,
profile: parser_feature_profile_for_runtime(),
};
assert!(snapshot.is_fully_implemented());
let partial = BddGovernanceSnapshot {
phase: BddPhase::Core,
implemented: 2,
total: 5,
profile: parser_feature_profile_for_runtime(),
};
assert!(!partial.is_fully_implemented());
}
#[test]
fn test_contract_lock_backend_selection() {
assert_eq!(current_backend_for(false), ParserBackend::select(false));
}