zed/crates/gpui2/tests/action_macros.rs
2023-12-10 19:33:38 -07:00

52 lines
1.1 KiB
Rust

use gpui2::{actions, impl_actions};
use gpui2_macros::register_action;
use serde_derive::Deserialize;
#[test]
fn test_action_macros() {
use gpui2 as gpui;
actions!(test, [TestAction]);
#[derive(PartialEq, Clone, Deserialize)]
struct AnotherTestAction;
impl_actions!(test, [AnotherTestAction]);
#[derive(PartialEq, Clone, gpui::serde_derive::Deserialize)]
struct RegisterableAction {}
register_action!(RegisterableAction);
impl gpui::Action for RegisterableAction {
fn boxed_clone(&self) -> Box<dyn gpui::Action> {
todo!()
}
fn as_any(&self) -> &dyn std::any::Any {
todo!()
}
fn partial_eq(&self, _action: &dyn gpui::Action) -> bool {
todo!()
}
fn name(&self) -> &str {
todo!()
}
fn debug_name() -> &'static str
where
Self: Sized,
{
todo!()
}
fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>
where
Self: Sized,
{
todo!()
}
}
}