#![cfg(all(feature = "grammars", feature = "lang-abc"))]
#![allow(clippy::expect_used, clippy::unwrap_used)]
use panproto_parse::ParserRegistry;
const ABC_BEAM_SRC: &[u8] = b"X:1\nT:T\nM:4/4\nK:C\nCDEF GABc|\n";
#[test]
fn emit_pretty_abc_beam_notes_render_tight() {
let reg = ParserRegistry::new();
let schema = reg
.parse_with_protocol("abc", ABC_BEAM_SRC, "audit.abc")
.expect("parse");
let bytes = reg
.emit_pretty_with_protocol("abc", &schema)
.expect("emit_pretty");
let text = String::from_utf8(bytes).expect("utf8");
let pre_fix_loose = ["C D", "D E", "E F", "G A", "A B", "B c"];
let still_loose = pre_fix_loose.iter().filter(|p| text.contains(*p)).count();
assert!(
still_loose < pre_fix_loose.len(),
"every adjacent same-beam note pair still has a space inserted between it (pre-fix regression): {text:?}"
);
}