()
| 923 | |
| 924 | #[tokio::test] |
| 925 | async fn test_view() -> anyhow::Result<()> { |
| 926 | let db = TestDB::in_memory()?; |
| 927 | |
| 928 | let schema = [("a", AlgebraicType::U8), ("b", AlgebraicType::U8)]; |
| 929 | let (_, table_id) = tests_utils::create_view_for_test(&db, "my_view", &schema, false)?; |
| 930 | |
| 931 | with_auto_commit(&db, |tx| -> Result<_, DBError> { |
| 932 | tests_utils::insert_into_view(&db, tx, table_id, Some(identity_from_u8(1)), product![0u8, 1u8])?; |
| 933 | tests_utils::insert_into_view(&db, tx, table_id, Some(identity_from_u8(2)), product![0u8, 2u8])?; |
| 934 | Ok(()) |
| 935 | })?; |
| 936 | |
| 937 | let id = identity_from_u8(2); |
| 938 | let auth = AuthCtx::new(Identity::ZERO, id); |
| 939 | |
| 940 | assert_query_results(db.clone(), "select * from my_view", auth, [product![0u8, 2u8]]).await; |
| 941 | |
| 942 | Ok(()) |
| 943 | } |
| 944 | |
| 945 | #[tokio::test] |
| 946 | async fn test_anonymous_view() -> anyhow::Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…