()
| 944 | |
| 945 | #[tokio::test] |
| 946 | async fn test_anonymous_view() -> anyhow::Result<()> { |
| 947 | let db = TestDB::in_memory()?; |
| 948 | |
| 949 | let schema = [("a", AlgebraicType::U8), ("b", AlgebraicType::U8)]; |
| 950 | let (_, table_id) = tests_utils::create_view_for_test(&db, "my_view", &schema, true)?; |
| 951 | |
| 952 | with_auto_commit(&db, |tx| -> Result<_, DBError> { |
| 953 | tests_utils::insert_into_view(&db, tx, table_id, None, product![0u8, 1u8])?; |
| 954 | tests_utils::insert_into_view(&db, tx, table_id, None, product![0u8, 2u8])?; |
| 955 | Ok(()) |
| 956 | })?; |
| 957 | |
| 958 | let id = identity_from_u8(1); |
| 959 | let auth = AuthCtx::new(Identity::ZERO, id); |
| 960 | |
| 961 | assert_query_results( |
| 962 | db.clone(), |
| 963 | "select b from my_view", |
| 964 | auth, |
| 965 | [product![1u8], product![2u8]], |
| 966 | ) |
| 967 | .await; |
| 968 | |
| 969 | Ok(()) |
| 970 | } |
| 971 | |
| 972 | #[tokio::test] |
| 973 | async fn test_view_join_table() -> anyhow::Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…