use palkia::prelude::*;
use serde::{Deserialize, Serialize};
#[test]
fn query() {
let mut world = World::new();
let foo = world.spawn().with(Foo).build();
let bar = world.spawn().with(Bar).build();
let foobar = world.spawn().with(Foo).with(Bar).build();
let foobaz = world.spawn().with(Foo).with(Baz).build();
let empty = world.spawn_empty();
assert!(world.query::<&Foo>(foo).is_some());
assert!(world.query::<&Bar>(bar).is_some());
assert!(world.query::<&Baz>(foobaz).is_some());
assert!(world.query::<(&Foo, &Bar)>(foobar).is_some());
assert!(world.query::<(&Foo, &Baz)>(foobaz).is_some());
assert!(world.query::<&Foo>(bar).is_none());
assert!(world.query::<(&Foo, &Bar)>(foo).is_none());
let q = world.query::<(Option<&Foo>, &Bar)>(foobar).unwrap();
assert!(q.0.is_some());
let q = world.query::<(Option<&Foo>, &Bar)>(foobaz);
assert!(q.is_none());
let q = world.query::