#![allow(dead_code)] use cfg::*; use gearley::grammar::History; pub fn assert_eq_rules(i: I, j: J) where R1: GrammarRule, R2: GrammarRule, I: Iterator, J: Iterator { let rules_i = i.map(|rule| (rule.lhs(), rule.rhs().to_vec())).collect::>(); let rules_j = j.map(|rule| (rule.lhs(), rule.rhs().to_vec())).collect::>(); assert_eq!(rules_i, rules_j); } pub fn assert_eq_origins(i: I, j: Vec>) where R: GrammarRule, I: Iterator { let origins_i = i.map(|rule| rule.history().origin()).collect::>(); assert_eq!(origins_i, j); }