@tscircuit/schematic-trace-solver 0.0.176 → 0.0.177

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import type { InputProblem } from "lib/types/InputProblem"
4
+ import "tests/fixtures/matcher"
5
+ import inputProblem from "./assets/repro-smartwatch-power-sheet.input.json"
6
+
7
+ test("smartwatch power sheet", () => {
8
+ const solver = new SchematicTracePipelineSolver(
9
+ inputProblem as unknown as InputProblem,
10
+ {
11
+ hideRatsNet: true,
12
+ },
13
+ )
14
+ solver.solve()
15
+
16
+ const connectorGroundPinIds = new Set([
17
+ "schematic_port_0",
18
+ "schematic_port_11",
19
+ ])
20
+ const connectorGroundLabels = solver
21
+ .netLabelToTraceSolver!.getOutput()
22
+ .netLabelPlacements.filter((label) =>
23
+ label.pinIds.some((pinId) => connectorGroundPinIds.has(pinId)),
24
+ )
25
+ expect(connectorGroundLabels).toHaveLength(1)
26
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
27
+ })
@@ -56,6 +56,17 @@ test("marked ground nets retain explicit islands even with identical netIds", ()
56
56
  )
57
57
  })
58
58
 
59
+ test("unwired same-component ground pins share a local connection", () => {
60
+ const inputProblem = createInput()
61
+ inputProblem.chips[4]!.pins.push({ pinId: "F", x: 2.2, y: 0.1 })
62
+ inputProblem.netConnections[0]!.pinIds.push("F")
63
+
64
+ const solver = new MspConnectionPairSolver({ inputProblem })
65
+ solver.solve()
66
+
67
+ expect(pairKeys(solver)).toEqual(["A-B", "C-D", "E-F"])
68
+ })
69
+
59
70
  test.each([false, undefined])(
60
71
  "isGround=%s preserves automatic net routing",
61
72
  (isGround) => {