Skip to content

Commit

Permalink
repro of issue with ts gen
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Jul 9, 2024
1 parent 365008d commit dd5c028
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/convert-to-ts/C88224-to-ts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@ it("should convert c88224 into typescript file", async () => {
easyeda,
soup,
})

console.log(result)

// This basically means a number wasn't converted properly- EasyEDA uses "mil"
// or "tenth-mil" for it's internal units, when we first parse them we add
// the "mil" suffix so that everything has a unit- but for some reason in some
// places we're not calling the mm(...) function from @tscircuit/mm to properly
// convert the number to mm OR we're taking the string "XXXmil" and just adding
// "mm" to it.... In tscircuit putting "XXXmil" OR "XXXmm" is acceptable but
// you can't do "XXXmilmm".
expect(result).not.toContain("milmm")

Check failure on line 26 in tests/convert-to-ts/C88224-to-ts.test.ts

View workflow job for this annotation

GitHub Actions / build

error: expect(received).not.toContain(expected)

Expected to not contain: "milmm" Received: "import { createUseComponent } from \"tscircuit\"\nimport type { CommonLayoutProps } from \"@tscircuit/props\"\n\nconst pinLabels = {\n \"1\": \"AO1\",\n \"2\": \"AO1\",\n \"3\": \"PGND1\",\n \"4\": \"PGND1\",\n \"5\": \"AO2\",\n \"6\": \"AO2\",\n \"7\": \"BO2\",\n \"8\": \"BO2\",\n \"9\": \"PGND2\",\n \"10\": \"PGND2\",\n \"11\": \"BO1\",\n \"12\": \"BO1\",\n \"13\": \"13\",\n \"14\": \"14\",\n \"15\": \"15\",\n \"16\": \"16\",\n \"17\": \"17\",\n \"18\": \"18\",\n \"19\": \"19\",\n \"20\": \"20\",\n \"21\": \"21\",\n \"22\": \"22\",\n \"23\": \"23\",\n \"24\": \"24\"\n} as const\nconst pinNames = Object.values(pinLabels)\n\ninterface Props extends CommonLayoutProps {\n name: string\n}\n\nexport const C88224 = (props: Props) => {\n return (\n <bug\n {...props}\n footprint={<footprint>\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"1\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"2\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"3\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"4\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"5\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"6\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"7\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"8\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"9\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"10\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"11\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"12\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"24\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"23\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969milmm\"\n shape=\"rect\"\n portHints={[\"22\"]}\n />\n <smtpad\n pcbX=\"NaNmm\"\n pcbY=\"NaNmm\"\n width=\"14.331milmm\"\n height=\"81.969
expect(result).not.toContain("NaNmm")
})

0 comments on commit dd5c028

Please sign in to comment.