Lines
100 %
Functions
32.5 %
Branches
use core::fmt::Debug;
use bonsaidb::core::api::{Api, ApiName};
use bonsaidb::core::schema::Qualified;
use serde::{Deserialize, Serialize};
#[test]
fn core() {
#[derive(Api, Debug, Serialize, Deserialize)]
#[api(name = "name", core = ::bonsaidb::core)]
struct Test;
assert_eq!(Test::name(), ApiName::private("name"));
}
fn name_only() {
#[api(name = "name")]
fn name_and_authority() {
#[api(name = "name", authority = "authority")]
assert_eq!(Test::name(), ApiName::new("authority", "name"));
fn error() {
#[api(name = "name", authority = "authority", error = String)]
assert_eq!(<Test as Api>::Error::new(), String::new());
fn response() {
#[api(name = "name", authority = "authority", response = String)]
assert_eq!(<Test as Api>::Response::new(), String::new());