use wal_core::{ component::{behavior::Behavior, Component}, virtual_dom::{VComponent, VNode}, }; use wal_rsx::rsx; include!("../utils/custom_components/custom_component_props_i32.rs"); include!("../utils/custom_components/custom_component_props_struct.rs"); include!("../utils/custom_components/custom_component_props_tuple_struct.rs"); fn main() { custom_component_props_i32(); custom_component_props_i32_proprs_reference(); custom_component_props_tuple_struct(); custom_component_props_struct(); custom_component_props_tuple_struct_with_struct_expression(); custom_component_props_struct_with_struct_expression(); custom_component_props_i32_with_key(); custom_component_props_i32_proprs_reference_with_key(); custom_component_props_tuple_struct_with_key(); custom_component_props_struct_with_key(); custom_component_props_tuple_struct_with_struct_expression_with_key(); custom_component_props_struct_with_struct_expression_with_key(); } fn custom_component_props_i32() { let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::(1, None)) ); } fn custom_component_props_i32_proprs_reference() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::(props_val, None)) ); } fn custom_component_props_tuple_struct() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( PropsTupleStruct::new(props_val), None )) ); } fn custom_component_props_struct() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( PropsStruct::new(props_val), None )) ); } fn custom_component_props_tuple_struct_with_struct_expression() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( PropsTupleStruct(props_val), None )) ); } fn custom_component_props_struct_with_struct_expression() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( PropsStruct { x: props_val }, None )) ); } fn custom_component_props_i32_with_key() { let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( 1, Some("key".to_string()) )) ); } fn custom_component_props_i32_proprs_reference_with_key() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( props_val, Some("key".to_string()) )) ); } fn custom_component_props_tuple_struct_with_key() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( PropsTupleStruct::new(props_val), Some("key".to_string()) )) ); } fn custom_component_props_struct_with_key() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( PropsStruct::new(props_val), Some("key".to_string()) )) ); } fn custom_component_props_tuple_struct_with_struct_expression_with_key() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( PropsTupleStruct(props_val), Some("key".to_string()) )) ); } fn custom_component_props_struct_with_struct_expression_with_key() { let props_val = 1; let rsx = rsx! { }; assert_eq!( rsx, VNode::Component(VComponent::new::( PropsStruct { x: props_val }, Some("key".to_string()) )) ); }