mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-13 10:42:09 +10:00
Controllers (#1080)
* initial * more components * fixes * Update TreePanel.java * fix boost converter * Improve wrapping of component names * Update ULN2003Driver.java * Update NRF24L01Transceiver.java * imp * updates * improvements * more components * arduino * uno * icon * cleanup * mega * mega * improveent * nano * esp boards * esp * esp32 * esp32 * Update ESP8266NodeMCU.java * d1 * Update WemosD1Mini.java * pi * consolidate esp32 * pi pico updates * pi zero * Update RaspberryPiZero.java * pi pico * cleanup * pi improvements * consolidate pins * antenna consolidation * improve solder pads * teensy * headers * teensy fix, test cleanup * s3 * Update ESP32DevKit.java * usb standardization * pico w * button standardization * arduino improvements * Update AbstractMakerBoard.java * Update RaspberryPiZero.java * Update RaspberryPi.java * pi 3 * pi 5 improvements * Update RaspberryPiZero.java * fix tests * esp pinout fix * Update ESP32DevKit.java * pin name improvements * Create tier-1-modern-boards.md * new versions * pinouts * nano improvements * sanitize node names * label improvements * minima fixes * arduino uno labels * nano labels * Update ArduinoNano.java * mega * mega * comment out future stuff * release prep * Update RaspberryPiPico.java * Refactor abstract class * labeling improvement * label offset fixes * Update Teensy.java * consolidate tests * micro variants * Update RaspberryPi.java * displays tweaks * display improvements * neopix * displays * improvements * led matrix * strip * led bar graph * jewel * tft * tft * Update maker-peripherals.md * nokia * led bar * labels * tft * cleanup * oled * cleanup * display enhancement * displays * neopixel * displays * displays * new tft * displays * icon * variants * 2-digit 0.56 inch 7 segment * Added ability to hide component categories in the component tree and toolbar from the Config menu * led bar * Update variants.xml * color selection for bar graph * Added 1.8" sd * tft fixes * Update WS2812BRing.java * neopixel improvements * netlist and node name improvements * oled tweak * cleanup * mockito fix --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,4 +48,41 @@ public class NodeNameTest {
|
||||
Assert.assertEquals("(only annotation)", Node.sanitizeNodeName("(only annotation)"));
|
||||
Assert.assertNull(Node.sanitizeNodeName(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void railNameDropsOnlyANumericDisambiguator() {
|
||||
Assert.assertEquals("GND", Node.railName("GND_1"));
|
||||
Assert.assertEquals("GND", Node.railName("GND_12"));
|
||||
Assert.assertEquals("GND", Node.railName("GND"));
|
||||
Assert.assertEquals("GND", Node.railName("GND (Pin 6)"));
|
||||
Assert.assertEquals("+5V", Node.railName("+5V_2"));
|
||||
// the annotation is stripped before the disambiguator, so an annotated rail still resolves
|
||||
Assert.assertEquals("3.3V", Node.railName("3.3V_2 (250mA)"));
|
||||
Assert.assertEquals("GND", Node.railName("GND_4 (Mid)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void railNameKeepsNonNumericQualifiers() {
|
||||
// namespaced connector signals
|
||||
Assert.assertEquals("ETH_TX-", Node.railName("ETH_TX-"));
|
||||
Assert.assertEquals("USB_D+", Node.railName("USB_D+"));
|
||||
// qualifiers that name a separate net
|
||||
Assert.assertEquals("MISO_16U2", Node.railName("MISO_16U2"));
|
||||
Assert.assertEquals("3V3_EN", Node.railName("3V3_EN"));
|
||||
// a bare trailing digit is part of the name, not a disambiguator
|
||||
Assert.assertEquals("GP1", Node.railName("GP1"));
|
||||
Assert.assertEquals("GND1", Node.railName("GND1"));
|
||||
// digits that are not at the end are part of the name too: the 16U2 bridge's ground and 5V
|
||||
// are separate nets from the board's own, and USB_5V is a connector pin, not a 5V rail
|
||||
Assert.assertEquals("GND_16U2", Node.railName("GND_16U2"));
|
||||
Assert.assertEquals("5V_16U2", Node.railName("5V_16U2"));
|
||||
Assert.assertEquals("USB_5V", Node.railName("USB_5V"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void railNameRejectsPinsThatNameNoNet() {
|
||||
Assert.assertNull(Node.railName("NC_1"));
|
||||
Assert.assertNull(Node.railName("RSV_2"));
|
||||
Assert.assertNull(Node.railName(null));
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
member-accessor-reflection
|
||||
@@ -0,0 +1 @@
|
||||
mock-maker-subclass
|
||||
Reference in New Issue
Block a user