Files
oak-gpui/tests/action_macros.rs
T
Nate Butler 18aeb44a54 Start reorganizing examples (#10)
* Update crate name

* wip

* reduce to just the gpui crate

* Fix misisng example images

* Delete ownership_post.rs

* Update Cargo.toml

* Update README.md

* bump to 0.3.3

* organize

* organize

* Add more learn examples

* Delete _ownership_and_data_flow.rs

* wip learn examples

* Fix colors

* tidy

* Move _template up

* add animation example

* Update examples

* remove legacy examples from toml

* Delete examples.toml
2025-12-28 23:14:33 -05:00

56 lines
1.3 KiB
Rust

use gpui::{Action, actions};
use gpui_macros::register_action;
use schemars::JsonSchema;
use serde::Deserialize;
#[test]
fn test_action_macros() {
actions!(
test_only,
[
SomeAction,
/// Documented action
SomeActionWithDocs,
]
);
#[derive(PartialEq, Clone, Deserialize, JsonSchema, Action)]
#[action(namespace = test_only)]
#[serde(deny_unknown_fields)]
struct AnotherAction;
#[derive(PartialEq, Clone, gpui::private::serde::Deserialize)]
#[serde(deny_unknown_fields)]
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) -> &'static str {
unimplemented!()
}
fn name_for_type() -> &'static str
where
Self: Sized,
{
unimplemented!()
}
fn build(_value: serde_json::Value) -> anyhow::Result<Box<dyn gpui::Action>>
where
Self: Sized,
{
unimplemented!()
}
}
}