Skip to main content

ironwork_syntax/
feedback.rs

1//! CEEIGZCT, ironwork's own declaration of Language Environment's feedback codes for a COPY
2//! CEEIGZCT that no library answers. The conditions and their tokens are `rt::feedback`.
3
4pub use rt::feedback::{conditions, symbol, token};
5
6/// CEEIGZCT: a condition name per condition, for the COPY that follows the 8-byte group the
7/// condition token begins with (SA38-0682-60, Figure 76).
8pub fn member() -> String {
9    conditions()
10        .map(|(number, severity)| {
11            let hex: String = token(severity, number).iter().map(|b| format!("{b:02X}")).collect();
12            format!("           88 {} VALUE X'{hex}'.\n", symbol(number))
13        })
14        .collect()
15}
16
17#[cfg(test)]
18mod tests {
19    use super::*;
20
21    #[test]
22    fn the_member_names_each_condition_in_area_b() {
23        let member = member();
24        let lines: Vec<&str> = member.lines().collect();
25        assert_eq!(lines.len(), 723);
26        assert_eq!(lines[0], "           88 CEE000 VALUE X'0000000000000000'.");
27        assert!(lines.contains(&"           88 CEE2EB VALUE X'000309CB59C3C5C5'."));
28        assert!(lines.contains(&"           88 CEE5KB VALUE X'0003168B59C3C5C5'."));
29        assert!(lines.iter().all(|l| l.len() <= 72));
30    }
31}