use tryparse::parser::strategies::{JsonFixerStrategy, ParsingStrategy};
#[test]
fn test_json_fixer_with_valid_json() {
let fixer = JsonFixerStrategy::default();
let input = r#"{"userName": "Alice", "maxCount": 30}"#;
println!("Testing with input: {}", input);
let candidates = fixer.parse(input).unwrap();
println!("Found {} candidates", candidates.len());
assert!(
candidates.is_empty(),
"JsonFixerStrategy should return no candidates for valid JSON (no fixes needed)"
);
}
#[test]
fn test_json_fixer_with_broken_json() {
let fixer = JsonFixerStrategy::default();
let input = r#"{"userName": "Alice", "maxCount": 30,}"#;
let candidates = fixer.parse(input).unwrap();
assert!(
!candidates.is_empty(),
"Should find candidates for broken JSON"
);
println!("Found {} candidates for broken JSON", candidates.len());
}