Skip to content

Commit d22f784

Browse files
committed
Set reproducible width for diff log
1 parent 94236a2 commit d22f784

File tree

2 files changed

+52
-56
lines changed

2 files changed

+52
-56
lines changed

R/utils.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ diff_lines <- function(case,
125125
diff <- diffobj::diffChr(
126126
before,
127127
after,
128-
format = "raw"
128+
format = "raw",
129+
# For reproducibility
130+
disp.width = 80
129131
)
130132

131133
# No format() method?

tests/mock.Rout.fail

+49-55
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,65 @@
11
Environment:
22
- vdiffr-svg-engine: 1.0
3-
- vdiffr: 0.3.2
3+
- vdiffr: 0.3.2.9000
44
- freetypeharfbuzz: 0.2.5
55

66

77
Failed doppelganger: myplot (../figs//myplot.svg)
88

9-
< before
10-
> after
11-
@@ 50,4 / 50,5 @@
12-
<rect x='641.70' y='402.67' width='20.81' height='118.72' style
13-
='stroke-width: 1.07; stroke: none; stroke-linecap: square; str
14-
oke-linejoin: miter; fill: #595959;' clip-path='url(#cpMjcuODl8
15-
NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
16-
<rect x='662.50' y='402.67' width='20.81' height='118.72' style
17-
='stroke-width: 1.07; stroke: none; stroke-linecap: square; str
18-
oke-linejoin: miter; fill: #595959;' clip-path='url(#cpMjcuODl8
19-
NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
20-
> <line x1='417.00' y1='545.13' x2='417.00' y2='22.77' style='str
21-
: oke-width: 1.07; stroke-linecap: butt;' clip-path='url(#cpMjcuO
22-
: Dl8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
23-
<rect x='27.89' y='22.77' width='686.64' height='522.36' style=
24-
'stroke-width: 1.07; stroke: #333333;' clip-path='url(#cpMjcuOD
25-
l8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
26-
<defs>
9+
< before
10+
> after
11+
@@ 50,4 / 50,5 @@
12+
<rect x='641.70' y='402.67' width='20.81' height='118.72' style='stroke-width:
13+
1.07; stroke: none; stroke-linecap: square; stroke-linejoin: miter; fill: #59
14+
5959;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
15+
<rect x='662.50' y='402.67' width='20.81' height='118.72' style='stroke-width:
16+
1.07; stroke: none; stroke-linecap: square; stroke-linejoin: miter; fill: #59
17+
5959;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
18+
> <line x1='417.00' y1='545.13' x2='417.00' y2='22.77' style='stroke-width: 1.07
19+
: ; stroke-linecap: butt;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw=
20+
: =)' />
21+
<rect x='27.89' y='22.77' width='686.64' height='522.36' style='stroke-width:
22+
1.07; stroke: #333333;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw==
23+
)' />
24+
<defs>
2725

2826

2927
Failed doppelganger: myplot (../figs//myplot.svg)
3028

31-
< before
32-
> after
33-
@@ 50,4 / 50,5 @@
34-
<rect x='641.70' y='402.67' width='20.81' height='118.72' style
35-
='stroke-width: 1.07; stroke: none; stroke-linecap: square; str
36-
oke-linejoin: miter; fill: #595959;' clip-path='url(#cpMjcuODl8
37-
NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
38-
<rect x='662.50' y='402.67' width='20.81' height='118.72' style
39-
='stroke-width: 1.07; stroke: none; stroke-linecap: square; str
40-
oke-linejoin: miter; fill: #595959;' clip-path='url(#cpMjcuODl8
41-
NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
42-
> <line x1='417.00' y1='545.13' x2='417.00' y2='22.77' style='str
43-
: oke-width: 1.07; stroke-linecap: butt;' clip-path='url(#cpMjcuO
44-
: Dl8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
45-
<rect x='27.89' y='22.77' width='686.64' height='522.36' style=
46-
'stroke-width: 1.07; stroke: #333333;' clip-path='url(#cpMjcuOD
47-
l8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
48-
<defs>
29+
< before
30+
> after
31+
@@ 50,4 / 50,5 @@
32+
<rect x='641.70' y='402.67' width='20.81' height='118.72' style='stroke-width:
33+
1.07; stroke: none; stroke-linecap: square; stroke-linejoin: miter; fill: #59
34+
5959;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
35+
<rect x='662.50' y='402.67' width='20.81' height='118.72' style='stroke-width:
36+
1.07; stroke: none; stroke-linecap: square; stroke-linejoin: miter; fill: #59
37+
5959;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
38+
> <line x1='417.00' y1='545.13' x2='417.00' y2='22.77' style='stroke-width: 1.07
39+
: ; stroke-linecap: butt;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw=
40+
: =)' />
41+
<rect x='27.89' y='22.77' width='686.64' height='522.36' style='stroke-width:
42+
1.07; stroke: #333333;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw==
43+
)' />
44+
<defs>
4945

5046

5147
Failed doppelganger: myplot (../figs//myplot.svg)
5248

53-
< before
54-
> after
55-
@@ 50,4 / 50,5 @@
56-
<rect x='641.70' y='402.67' width='20.81' height='118.72' style
57-
='stroke-width: 1.07; stroke: none; stroke-linecap: square; str
58-
oke-linejoin: miter; fill: #595959;' clip-path='url(#cpMjcuODl8
59-
NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
60-
<rect x='662.50' y='402.67' width='20.81' height='118.72' style
61-
='stroke-width: 1.07; stroke: none; stroke-linecap: square; str
62-
oke-linejoin: miter; fill: #595959;' clip-path='url(#cpMjcuODl8
63-
NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
64-
> <line x1='417.00' y1='545.13' x2='417.00' y2='22.77' style='str
65-
: oke-width: 1.07; stroke-linecap: butt;' clip-path='url(#cpMjcuO
66-
: Dl8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
67-
<rect x='27.89' y='22.77' width='686.64' height='522.36' style=
68-
'stroke-width: 1.07; stroke: #333333;' clip-path='url(#cpMjcuOD
69-
l8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
70-
<defs>
49+
< before
50+
> after
51+
@@ 50,4 / 50,5 @@
52+
<rect x='641.70' y='402.67' width='20.81' height='118.72' style='stroke-width:
53+
1.07; stroke: none; stroke-linecap: square; stroke-linejoin: miter; fill: #59
54+
5959;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
55+
<rect x='662.50' y='402.67' width='20.81' height='118.72' style='stroke-width:
56+
1.07; stroke: none; stroke-linecap: square; stroke-linejoin: miter; fill: #59
57+
5959;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw==)' />
58+
> <line x1='417.00' y1='545.13' x2='417.00' y2='22.77' style='stroke-width: 1.07
59+
: ; stroke-linecap: butt;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw=
60+
: =)' />
61+
<rect x='27.89' y='22.77' width='686.64' height='522.36' style='stroke-width:
62+
1.07; stroke: #333333;' clip-path='url(#cpMjcuODl8NzE0LjUyfDU0NS4xM3wyMi43Nw==
63+
)' />
64+
<defs>
7165

0 commit comments

Comments
 (0)