()
| 619 | |
| 620 | #[tokio::test] |
| 621 | async fn state_table_tests() { |
| 622 | let db = Database::new().await.unwrap(); |
| 623 | |
| 624 | // set |
| 625 | db.set_entry(Table::State, "test", "test").unwrap(); |
| 626 | db.set_entry(Table::State, "int", 1).unwrap(); |
| 627 | db.set_entry(Table::State, "float", 1.0).unwrap(); |
| 628 | db.set_entry(Table::State, "bool", true).unwrap(); |
| 629 | db.set_entry(Table::State, "array", vec![1, 2, 3]).unwrap(); |
| 630 | db.set_entry(Table::State, "object", serde_json::json!({ "test": "test" })) |
| 631 | .unwrap(); |
| 632 | db.set_entry(Table::State, "binary", b"test".to_vec()).unwrap(); |
| 633 | |
| 634 | // unset |
| 635 | db.delete_entry(Table::State, "test").unwrap(); |
| 636 | db.delete_entry(Table::State, "int").unwrap(); |
| 637 | |
| 638 | // is some |
| 639 | assert!(db.get_entry::<String>(Table::State, "test").unwrap().is_none()); |
| 640 | assert!(db.get_entry::<i32>(Table::State, "int").unwrap().is_none()); |
| 641 | assert!(db.get_entry::<f32>(Table::State, "float").unwrap().is_some()); |
| 642 | assert!(db.get_entry::<bool>(Table::State, "bool").unwrap().is_some()); |
| 643 | } |
| 644 | |
| 645 | #[tokio::test] |
| 646 | #[ignore = "not on ci"] |
nothing calls this directly
no test coverage detected