mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-03 12:18:13 +08:00
Adapt the test surface to our wire kind and no-content graphic
This commit is contained in:
@@ -4354,8 +4354,9 @@ mod document_message_handler_tests {
|
|||||||
let phantom_count = news
|
let phantom_count = news
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|new| new.iter_element_values())
|
.flat_map(|new| new.iter_element_values())
|
||||||
.filter(|graphic| matches!(graphic, graphene_std::Graphic::None(_)))
|
// Our no-content graphic is an empty list rather than master's dedicated None variant
|
||||||
|
.filter(|graphic| graphic.is_empty())
|
||||||
.count();
|
.count();
|
||||||
assert_eq!(phantom_count, 0, "No stacked element should be a phantom None graphic");
|
assert_eq!(phantom_count, 0, "No stacked element should be a phantom empty graphic");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2921,7 +2921,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn removed_definition_swap_targets_resolve() {
|
fn removed_definition_swap_targets_resolve() {
|
||||||
assert!(resolve_proto_node_type(graphene_std::ops::passthrough::IDENTIFIER).is_some());
|
assert!(resolve_proto_node_type(graphene_std::ops::passthrough::IDENTIFIER).is_some());
|
||||||
assert!(resolve_proto_node_type(graphene_std::platform_application_io::upload_texture::IDENTIFIER).is_some());
|
#[cfg(feature = "gpu")]
|
||||||
|
assert!(resolve_proto_node_type(wgpu_executor::texture_conversion::upload_texture::IDENTIFIER).is_some());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrating a Merge network's coercion nodes by alias would leave a reducer in the primary slot, so every alias must reset instead
|
// Migrating a Merge network's coercion nodes by alias would leave a reducer in the primary slot, so every alias must reset instead
|
||||||
|
|||||||
@@ -1026,7 +1026,7 @@ mod typedefault_dispatch {
|
|||||||
fn typedefault_dispatch_terminates() {
|
fn typedefault_dispatch_terminates() {
|
||||||
macro_rules! check {
|
macro_rules! check {
|
||||||
($type_default:ty, $stored:expr) => {{
|
($type_default:ty, $stored:expr) => {{
|
||||||
let ty: Type = $stored;
|
let ty: TypeDescriptor = $stored;
|
||||||
let expected_type_id = std::any::TypeId::of::<$type_default>();
|
let expected_type_id = std::any::TypeId::of::<$type_default>();
|
||||||
let dyn_value = TaggedValue::TypeDefault(ty.clone()).to_dynany();
|
let dyn_value = TaggedValue::TypeDefault(ty.clone()).to_dynany();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@@ -1045,22 +1045,17 @@ mod typedefault_dispatch {
|
|||||||
);
|
);
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
macro_rules! check_item {
|
// One wire kind: a type default names its type, so the item and list lists both check their list form.
|
||||||
($element:ty) => {
|
|
||||||
check!(Item<$element>, concrete!($element));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
macro_rules! check_list {
|
macro_rules! check_list {
|
||||||
($element:ty) => {
|
($element:ty) => {
|
||||||
check!(List<$element>, concrete!(List<$element>));
|
check!(List<$element>, core_types::descriptor!(List<$element>));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
macro_rules! check_bare {
|
macro_rules! check_bare {
|
||||||
($type_default:ty) => {
|
($type_default:ty) => {
|
||||||
check!($type_default, concrete!($type_default));
|
check!($type_default, core_types::descriptor!($type_default));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
for_each_item_type_default!(check_item);
|
|
||||||
for_each_list_type_default!(check_list);
|
for_each_list_type_default!(check_list);
|
||||||
for_each_bare_type_default!(check_bare);
|
for_each_bare_type_default!(check_bare);
|
||||||
}
|
}
|
||||||
@@ -1069,7 +1064,6 @@ mod typedefault_dispatch {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod paint_default_parsing {
|
mod paint_default_parsing {
|
||||||
use super::*;
|
use super::*;
|
||||||
use core_types::{item, list};
|
|
||||||
|
|
||||||
/// A Fill/Stroke paint wire carries `Graphic` elements, so its `Color::BLACK` default must parse through the
|
/// A Fill/Stroke paint wire carries `Graphic` elements, so its `Color::BLACK` default must parse through the
|
||||||
/// element recursion into a `Color` for a fresh Fill node's paint to resolve.
|
/// element recursion into a `Color` for a fresh Fill node's paint to resolve.
|
||||||
|
|||||||
Reference in New Issue
Block a user