Files
diodeinc__pcb/crates/pcb-star-core/tests/component.rs
Lenny Khazan e852477546 Initial release (#5)
* Initial release

* cargo-dist

* build and test CI

* update ubuntu workflow

* fmt

* ubuntu: install deps

* clippy: 0.1.88 fixes

* format

* install clippy

* Update README.md

* Don't run cargo-dist on PRs
2025-07-01 04:06:08 -04:00

45 lines
1.2 KiB
Rust

#[macro_use]
mod common;
snapshot_eval!(component_properties, {
"C146731.kicad_sym" => include_str!("resources/C146731.kicad_sym"),
"test_props.star" => r#"
# Import component factory from current directory.
load(".", MyComponent = "C146731")
# Instantiate with pin connections and a custom property.
MyComponent(
name = "U1",
pins = {
"ICLK": Net("ICLK"),
"Q1": Net("Q1"),
"Q2": Net("Q2"),
"Q3": Net("Q3"),
"Q4": Net("Q4"),
"GND": Net("GND"),
"VDD": Net("VDD"),
"OE": Net("OE"),
},
footprint = "SMD:0805",
properties = {"CustomProp": "Value123"},
)
"#
});
snapshot_eval!(interface_net_incompatible, {
"Module.star" => r#"
SingleNet = interface(signal = Net)
signal_if = SingleNet(name="sig")
Component(
name = "test_comp",
footprint = "test_footprint",
pin_defs = {"in": "1", "out": "2"},
pins = {
"in": signal_if, # This should fail - interfaces not accepted for pins
"out": Net()
}
)
"#
});