(
refs: Vec<TableReference>,
expected_lookup_count: u32,
found_tables: &[&str],
not_found_tables: &[&str],
)
| 487 | #[tokio::test] |
| 488 | async fn test_async_schema_provider_resolve() { |
| 489 | async fn check( |
| 490 | refs: Vec<TableReference>, |
| 491 | expected_lookup_count: u32, |
| 492 | found_tables: &[&str], |
| 493 | not_found_tables: &[&str], |
| 494 | ) { |
| 495 | let async_provider = MockAsyncSchemaProvider::default(); |
| 496 | let cached_provider = async_provider |
| 497 | .resolve(&refs, &test_config(), MOCK_CATALOG, MOCK_SCHEMA) |
| 498 | .await |
| 499 | .unwrap(); |
| 500 | |
| 501 | assert_eq!( |
| 502 | async_provider.lookup_count.load(Ordering::Acquire), |
| 503 | expected_lookup_count |
| 504 | ); |
| 505 | |
| 506 | for table_ref in found_tables { |
| 507 | let table = cached_provider.table(table_ref).await.unwrap(); |
| 508 | assert!(table.is_some()); |
| 509 | } |
| 510 | |
| 511 | for table_ref in not_found_tables { |
| 512 | assert!(cached_provider.table(table_ref).await.unwrap().is_none()); |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | // Basic full lookups |
| 517 | check( |
searching dependent graphs…