ZIm/crates/gpui/tests/action_macros.rs
Piotr Osiewicz 0b75c13034
chore: Replace as_any functions with trait upcasting (#28221)
Closes #ISSUE

Release Notes:

- N/A
2025-04-08 22:16:27 +02:00

47 lines
1.1 KiB
Rust

use gpui::{actions, impl_actions};
use gpui_macros::register_action;
use schemars::JsonSchema;
use serde_derive::Deserialize;
#[test]
fn test_action_macros() {
actions!(test, [TestAction]);
#[derive(PartialEq, Clone, Deserialize, JsonSchema)]
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> {
unimplemented!()
}
fn partial_eq(&self, _action: &dyn gpui::Action) -> bool {
unimplemented!()
}
fn name(&self) -> &str {
unimplemented!()
}
fn debug_name() -> &'static str
where
Self: Sized,
{
unimplemented!()
}
fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>
where
Self: Sized,
{
unimplemented!()
}
}
}