zed/crates/gpui/tests/action_macros.rs

51 lines
1.1 KiB
Rust
Raw Normal View History

use gpui::{actions, impl_actions};
use gpui_macros::register_action;
use serde_derive::Deserialize;
#[test]
fn test_action_macros() {
actions!(test, [TestAction]);
#[derive(PartialEq, Clone, Deserialize)]
struct AnotherTestAction;
impl_actions!(test, [AnotherTestAction]);
#[derive(PartialEq, Clone, gpui::private::serde_derive::Deserialize)]
struct RegisterableAction {}
register_action!(RegisterableAction);
impl gpui::Action for RegisterableAction {
fn boxed_clone(&self) -> Box<dyn gpui::Action> {
2024-01-09 11:13:40 +03:00
unimplemented!()
}
fn as_any(&self) -> &dyn std::any::Any {
2024-01-09 11:13:40 +03:00
unimplemented!()
}
fn partial_eq(&self, _action: &dyn gpui::Action) -> bool {
2024-01-09 11:13:40 +03:00
unimplemented!()
}
fn name(&self) -> &str {
2024-01-09 11:13:40 +03:00
unimplemented!()
}
fn debug_name() -> &'static str
where
Self: Sized,
{
2024-01-09 11:13:40 +03:00
unimplemented!()
}
fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>
where
Self: Sized,
{
2024-01-09 11:13:40 +03:00
unimplemented!()
}
}
}