Skip to content

Commit 46c47ab

Browse files
committed
feat(seance): snapshot testing for all top-level stages
1 parent a8f78f7 commit 46c47ab

8 files changed

Lines changed: 38 additions & 25 deletions

seance/tests/hpgl_snapshots.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,20 @@ fn hackspace_logo() {
1414
}
1515

1616
let paths = seance::svg::get_paths_grouped_by_colour(&design_file);
17+
insta::assert_debug_snapshot!("york hackspace logo SVG paths", &paths);
18+
1719
let mut paths_in_mm = seance::resolve_paths(&paths, &offset, 1.0);
20+
insta::assert_debug_snapshot!("york hackspace logo resolved paths", &paths_in_mm);
21+
1822
seance::paths::filter_paths_to_tool_passes(&mut paths_in_mm, &tool_passes);
23+
insta::assert_debug_snapshot!("york hackspace logo filtered paths", &paths_in_mm);
24+
1925
let resolved_paths = seance::paths::convert_points_to_plotter_units(&paths_in_mm);
26+
insta::assert_debug_snapshot!("york hackspace logo plotted paths", &resolved_paths);
27+
2028
let hpgl = seance::hpgl::generate_hpgl(&resolved_paths, &tool_passes);
21-
let pcl = seance::pcl::wrap_hpgl_in_pcl(hpgl, design_name, &tool_passes);
29+
insta::assert_snapshot!("york hackspace logo HPGL output", &hpgl);
2230

23-
insta::assert_snapshot!("york hackspace logo SVG PCL output", pcl);
31+
let pcl = seance::pcl::wrap_hpgl_in_pcl(hpgl, design_name, &tool_passes);
32+
insta::assert_snapshot!("york hackspace logo PCL output", &pcl);
2433
}

seance/tests/snapshots/hpgl_snapshots__york hackspace logo SVG HPGL output.snap renamed to seance/tests/snapshots/pcl_snapshots__york hackspace logo HPGL output.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
source: seance/tests/hpgl_snapshots.rs
3-
expression: hpgl
2+
source: seance/tests/pcl_snapshots.rs
3+
expression: "&hpgl"
44
---
55
IN;SC;PU;SP1;LT;PU0,18528;PU0,18528;SP0;EC0;EC1;OE;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
source: seance/tests/pcl_snapshots.rs
3+
expression: "&pcl"
4+
---
5+
%-12345XE!m19NYork Hackspace Logo!v16R1111111111111111!v64I0400040004000400040004000400040004000400040004000400040004000400!v64V0020002000200020002000200020002000200020002000200020002000200020!v64P0100010001000100010001000100010001000100010001000100010001000100!v16D*t508R&u508R!r0N%1A!r1000I!r1000K!r500P*t508R&u508R!m0S!s1S%1BIN;SC;PU;SP1;LT;PU0,18528;PU0,18528;SP0;EC0;EC1;OE;%1AE%-12345X
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
source: seance/tests/pcl_snapshots.rs
3+
expression: "&paths"
4+
---
5+
{}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
source: seance/tests/pcl_snapshots.rs
3+
expression: "&paths_in_mm"
4+
---
5+
{}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
source: seance/tests/pcl_snapshots.rs
3+
expression: "&resolved_paths"
4+
---
5+
{}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
source: seance/tests/pcl_snapshots.rs
3+
expression: "&paths_in_mm"
4+
---
5+
{}

0 commit comments

Comments
 (0)