use futures::TryStreamExt; use ubs_lib::{Course, Semester}; #[tokio::test] async fn schedule_iter() -> Result<(), ubs_lib::ScheduleError> { let mut schedule_iter = ubs_lib::schedule_iter(Course::Cse115, Semester::Spring2023).await?; #[allow(clippy::never_loop)] // TODO: temp while let Some(schedule) = schedule_iter.try_next().await? { for group in schedule?.group_iter() { println!("Session: {}", group.session()?); println!("Start Date: {}", group.start_date()?); println!("End Date: {}", group.end_date()?); println!(); for class in group.class_iter() { println!("Id: {}", class.class_type()?); println!("Open: {}", class.is_open()?); println!("Section: {}", class.section()?); println!("Days of Week: {:?}", class.days_of_week()?); println!("Start Time: {:?}", class.start_time()?); println!("End Time: {:?}", class.end_time()?); println!("Room: {}", class.room()?); println!("Insturctor: {}", class.instructor()?); println!("Open Seats: {:?}", class.open_seats()?); println!("Total Seats: {:?}", class.total_seats()?); println!(); } println!(); } break; // TODO: for now since subsequent pages aren't implemented } Ok(()) }