#![allow(clippy::type_complexity)] use std::{borrow::Borrow, iter::{repeat_with, FromIterator}}; use kul_core::{ Parser, Datum, parser::{DatumAllocator, premade::{PairOperatorBindings, SliceDatumAllocator, DefaultCharClassifier}}, combiner::{Combiner, OpFn, ApFn}, text::{premade::TextDatumList, chunk::premade::PosStr}, datum::premade::MutRefDatum, }; use kul_shared_tests::{suites::test_suite0, bindings::BindingsSpec}; fn parser( allocator: DA, bindings: B, ) -> Parser>, Box>, CE>> where DA: DatumAllocator, B: Borrow<[(Datum, Combiner>, Box>>)]> { Parser { classifier: DefaultCharClassifier, allocator, bindings: PairOperatorBindings::new(bindings), } } #[test] fn suite0_core_types() { type CombErr = u16; type Extra = bool; type Array<'a, 's> = [MutRefDatum<'a, TextDatumList<'a, PosStr<'s>, Extra>, Extra>]; let mut datum_array: Box> = Vec::from_iter(repeat_with(|| Datum::Extra(true)).take(0x200)) .into_boxed_slice(); test_suite0(parser::<_, _, CombErr>(SliceDatumAllocator::new(&mut datum_array[..]), BindingsSpec::default())); }