diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index e4db44d..573b79f 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -6,6 +6,7 @@ on: - src/** - tests/** - examples/** + - .github/** pull_request: branches: [ main ] @@ -22,17 +23,22 @@ jobs: packages: cargo version: 1.0 - - name: Install typst-test from github - uses: baptiste0928/cargo-install@v2.2.0 + - name: Install tytanic from crates.io + uses: baptiste0928/cargo-install@v3.0.0 with: - crate: typst-test - git: https://github.com/tingerrr/typst-test.git - tag: ci-semi-stable - - - name: Setup typst - uses: typst-community/setup-typst@v3 - with: - typst-version: 'v0.13.0' + crate: tytanic + version: '0.2.0' - name: Run test suite - run: typst-test run \ No newline at end of file + run: tt run + + - name: Archive artifacts + uses: actions/upload-artifact@v4 + if: always() + with: + name: artifacts + path: | + tests/**/diff/*.png + tests/**/out/*.png + tests/**/ref/*.png + retention-days: 5 \ No newline at end of file diff --git a/src/arrow.typ b/src/arrow.typ index 2e815e4..a155f94 100644 --- a/src/arrow.typ +++ b/src/arrow.typ @@ -14,7 +14,7 @@ let w = width/2 let v1 = (arrow-start.at(0) - w*normal.at(0), arrow-start.at(1) - w*normal.at(1)) let v2 = (arrow-start.at(0) + w*normal.at(0), arrow-start.at(1) + w*normal.at(1)) - path(arrow-end, v1, v2, closed: true, fill: arrow-color) + polygon(arrow-end, v1, v2, fill: arrow-color) } #let test-arrow() = { diff --git a/src/draw-functions.typ b/src/draw-functions.typ index 6738bec..847af79 100644 --- a/src/draw-functions.typ +++ b/src/draw-functions.typ @@ -138,7 +138,13 @@ width: width, height: height, inset: 0pt, { let center-x = width / 2 - place(path((0%, 110%), ((50%, 40%), (-40%, 0pt)), (100%, 110%), stroke: stroke)) + // place(path((0%, 110%), ((50%, 40%), (-40%, 0pt)), (100%, 110%), stroke: stroke)) + place(curve( + curve.move((0%, 110%)), + curve.quad((13%, 40%), (50%, 40%)), + curve.quad(auto, (100%, 110%)), + stroke: stroke + )) set align(left) arrow.draw-arrow((center-x, height * 1.2), (width * .9, height*.3), length: 3.8pt, width: 2.8pt, stroke: stroke, arrow-color: draw-params.color) }) @@ -187,9 +193,17 @@ let y-from = draw-params.center-y-coords.at(from + gate.qubit) - y0 let y-to = draw-params.center-y-coords.at(to + gate.qubit) - y0 if separation != none { - place(path(((0pt,y-from), (-bend, 0pt)), ((width, y-to), (-bend, 0pt)), stroke: separation)) + place(curve( + curve.move((0pt, y-from)), + curve.cubic((bend, y-from), (width - bend, y-to), (width, y-to)), + stroke: separation + )) } - place(path(((-.1pt,y-from), (-bend, 0pt)), ((width+.1pt, y-to), (-bend, 0pt)), stroke: draw-params.wire)) + place(curve( + curve.move((-.1pt, y-from)), + curve.cubic((bend, y-from), (width + .1pt - bend, y-to), (width + .1pt, y-to)), + stroke: draw-params.wire + )) } } ) diff --git a/tests/examples/fault-tolerant-measurement/ref/1.png b/tests/examples/fault-tolerant-measurement/ref/1.png index d7b0c24..94759ca 100644 Binary files a/tests/examples/fault-tolerant-measurement/ref/1.png and b/tests/examples/fault-tolerant-measurement/ref/1.png differ diff --git a/tests/examples/fault-tolerant-toffoli1/ref/1.png b/tests/examples/fault-tolerant-toffoli1/ref/1.png index 2ed3209..b1ddd67 100644 Binary files a/tests/examples/fault-tolerant-toffoli1/ref/1.png and b/tests/examples/fault-tolerant-toffoli1/ref/1.png differ diff --git a/tests/examples/fault-tolerant-toffoli2/ref/1.png b/tests/examples/fault-tolerant-toffoli2/ref/1.png index 3758acd..22c798e 100644 Binary files a/tests/examples/fault-tolerant-toffoli2/ref/1.png and b/tests/examples/fault-tolerant-toffoli2/ref/1.png differ diff --git a/tests/examples/teleportation/ref/1.png b/tests/examples/teleportation/ref/1.png index e7cd47b..bc5b1c6 100644 Binary files a/tests/examples/teleportation/ref/1.png and b/tests/examples/teleportation/ref/1.png differ diff --git a/tests/gates/meter/ref/1.png b/tests/gates/meter/ref/1.png index a72013f..f200c21 100644 Binary files a/tests/gates/meter/ref/1.png and b/tests/gates/meter/ref/1.png differ diff --git a/tests/gates/meter/ref/2.png b/tests/gates/meter/ref/2.png index d13620c..b7d11df 100644 Binary files a/tests/gates/meter/ref/2.png and b/tests/gates/meter/ref/2.png differ diff --git a/tests/gates/meter/ref/3.png b/tests/gates/meter/ref/3.png index a5a5330..c2a1f10 100644 Binary files a/tests/gates/meter/ref/3.png and b/tests/gates/meter/ref/3.png differ diff --git a/tests/gates/permute/ref/1.png b/tests/gates/permute/ref/1.png index bb4ac41..7061b69 100644 Binary files a/tests/gates/permute/ref/1.png and b/tests/gates/permute/ref/1.png differ diff --git a/tests/gates/permute/ref/2.png b/tests/gates/permute/ref/2.png index 59e8049..406a70b 100644 Binary files a/tests/gates/permute/ref/2.png and b/tests/gates/permute/ref/2.png differ diff --git a/tests/gates/permute/ref/3.png b/tests/gates/permute/ref/3.png index 911cefc..9648390 100644 Binary files a/tests/gates/permute/ref/3.png and b/tests/gates/permute/ref/3.png differ diff --git a/tests/layout/placed-items/ref/1.png b/tests/layout/placed-items/ref/1.png index 0104e91..0dda799 100644 Binary files a/tests/layout/placed-items/ref/1.png and b/tests/layout/placed-items/ref/1.png differ diff --git a/tests/tequila/basic/ref/2.png b/tests/tequila/basic/ref/2.png index 167a748..e838a51 100644 Binary files a/tests/tequila/basic/ref/2.png and b/tests/tequila/basic/ref/2.png differ diff --git a/tests/tequila/basic/ref/8.png b/tests/tequila/basic/ref/8.png index 387f083..a072ac4 100644 Binary files a/tests/tequila/basic/ref/8.png and b/tests/tequila/basic/ref/8.png differ diff --git a/tests/wire/mode/ref/1.png b/tests/wire/mode/ref/1.png index afe3e86..2841542 100644 Binary files a/tests/wire/mode/ref/1.png and b/tests/wire/mode/ref/1.png differ