Skip to content

Commit

Permalink
chore: use .svg.txt extension on plugin test files (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkenny54 authored Jan 4, 2024
1 parent 51c59f5 commit 9e01769
Show file tree
Hide file tree
Showing 326 changed files with 31 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ test/regression-diffs
test/cli/output
coverage
.DS_Store
.vscode
*.log
2 changes: 1 addition & 1 deletion test/plugins/_index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
import { optimize } from '../../lib/svgo.js';

const regEOL = new RegExp(EOL, 'g');
const regFilename = /^(.*)\.(\d+)\.svg$/;
const regFilename = /^(.*)\.(\d+)\.svg\.txt$/;
const __dirname = PATH.dirname(fileURLToPath(import.meta.url));

describe('plugins tests', function () {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg">
<style>
.prefixIds_01_svg__test{color:blue}#prefixIds_01_svg__test{color:red}
.prefixIds_01_svg_txt__test{color:blue}#prefixIds_01_svg_txt__test{color:red}
</style>
<rect class="prefixIds_01_svg__test" x="10" y="10" width="100" height="100"/>
<rect class="" id="prefixIds_01_svg__test" x="10" y="10" width="100" height="100"/>
<rect class="prefixIds_01_svg_txt__test" x="10" y="10" width="100" height="100"/>
<rect class="" id="prefixIds_01_svg_txt__test" x="10" y="10" width="100" height="100"/>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="prefixIds_02_svg__MyGradient">
<linearGradient id="prefixIds_02_svg_txt__MyGradient">
<stop offset="5%" stop-color="green"/>
<stop offset="95%" stop-color="gold"/>
</linearGradient>
</defs>
<rect fill="url(#prefixIds_02_svg__MyGradient)" x="10" y="10" width="100" height="100"/>
<rect fill="url(#prefixIds_02_svg_txt__MyGradient)" x="10" y="10" width="100" height="100"/>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
@@@

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<use xlink:href="#prefixIds_03_svg__Port"/>
<use xlink:href="#prefixIds_03_svg_txt__Port"/>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg">
<style>
rect{cursor:pointer;shape-rendering:crispEdges;fill:url(#prefixIds_04_svg__MyGradient)}
rect{cursor:pointer;shape-rendering:crispEdges;fill:url(#prefixIds_04_svg_txt__MyGradient)}
</style>
<rect x="10" y="10" width="100" height="100"/>
<rect x="10" y="10" width="100" height="100"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@

<svg width="340" height="120" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="prefixIds_05_svg__gradient_1">
<linearGradient id="prefixIds_05_svg_txt__gradient_1">
<stop offset="5%" stop-color="green"/>
<stop offset="95%" stop-color="gold"/>
</linearGradient>
<linearGradient id="prefixIds_05_svg__gradient_2">
<linearGradient id="prefixIds_05_svg_txt__gradient_2">
<stop offset="5%" stop-color="red"/>
<stop offset="95%" stop-color="black"/>
</linearGradient>
<linearGradient id="prefixIds_05_svg__gradient_3">
<linearGradient id="prefixIds_05_svg_txt__gradient_3">
<stop offset="5%" stop-color="blue"/>
<stop offset="95%" stop-color="orange"/>
</linearGradient>
</defs>
<rect fill="url(#prefixIds_05_svg__gradient_1)" x="10" y="10" width="100" height="100"/>
<rect fill="url(#prefixIds_05_svg__gradient_2)" x="120" y="10" width="100" height="100"/>
<rect fill="url(#prefixIds_05_svg__gradient_3)" x="230" y="10" width="100" height="100"/>
<rect fill="url(#prefixIds_05_svg_txt__gradient_1)" x="10" y="10" width="100" height="100"/>
<rect fill="url(#prefixIds_05_svg_txt__gradient_2)" x="120" y="10" width="100" height="100"/>
<rect fill="url(#prefixIds_05_svg_txt__gradient_3)" x="230" y="10" width="100" height="100"/>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg">
<style>
.prefixIds_06_svg__test{color:blue}.prefixIds_06_svg__test2{color:green}#prefixIds_06_svg__test{color:red}.prefixIds_06_svg__test3 .prefixIds_06_svg__test4{color:black}.prefixIds_06_svg__test5.prefixIds_06_svg__test6{color:brown}.prefixIds_06_svg__test5.prefixIds_06_svg__test6 #prefixIds_06_svg__test7{color:yellow}
.prefixIds_06_svg_txt__test{color:blue}.prefixIds_06_svg_txt__test2{color:green}#prefixIds_06_svg_txt__test{color:red}.prefixIds_06_svg_txt__test3 .prefixIds_06_svg_txt__test4{color:black}.prefixIds_06_svg_txt__test5.prefixIds_06_svg_txt__test6{color:brown}.prefixIds_06_svg_txt__test5.prefixIds_06_svg_txt__test6 #prefixIds_06_svg_txt__test7{color:yellow}
</style>
<rect class="prefixIds_06_svg__test" x="10" y="10" width="100" height="100"/>
<rect class="prefixIds_06_svg__test prefixIds_06_svg__test2" x="10" y="10" width="100" height="100"/>
<rect class="prefixIds_06_svg__test prefixIds_06_svg__test2" x="10" y="10" width="100" height="100"/>
<rect class="" id="prefixIds_06_svg__test" x="10" y="10" width="100" height="100"/>
<rect class="prefixIds_06_svg_txt__test" x="10" y="10" width="100" height="100"/>
<rect class="prefixIds_06_svg_txt__test prefixIds_06_svg_txt__test2" x="10" y="10" width="100" height="100"/>
<rect class="prefixIds_06_svg_txt__test prefixIds_06_svg_txt__test2" x="10" y="10" width="100" height="100"/>
<rect class="" id="prefixIds_06_svg_txt__test" x="10" y="10" width="100" height="100"/>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg">
<style>
.prefixIds_07_svg__test{color:blue}#test{color:red}
.prefixIds_07_svg_txt__test{color:blue}#test{color:red}
</style>
<rect class="prefixIds_07_svg__test" x="10" y="10" width="100" height="100"/>
<rect class="prefixIds_07_svg_txt__test" x="10" y="10" width="100" height="100"/>
<rect class="" id="test" x="10" y="10" width="100" height="100"/>
</svg>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg">
<style>
.test{color:blue}#prefixIds_08_svg__test{color:red}
.test{color:blue}#prefixIds_08_svg_txt__test{color:red}
</style>
<rect class="test" x="10" y="10" width="100" height="100"/>
<rect class="" id="prefixIds_08_svg__test" x="10" y="10" width="100" height="100"/>
<rect class="" id="prefixIds_08_svg_txt__test" x="10" y="10" width="100" height="100"/>
</svg>

@@@
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
@@@

<g xmlns="http://www.w3.org/2000/svg" transform="translate(130, 112)">
<path class="prefixIds_10_svg__st1" d="M27,0h-37v64C-10,64,27,64.2,27,0z" transform="scale(0.811377 1)">
<animateTransform id="prefixIds_10_svg__t_1s" attributeName="transform" type="scale" from="1 1" to="-1 1" begin="0s; prefixIds_10_svg__t_2s.end" dur="0.5s" repeatCount="0"/>
<animateTransform id="prefixIds_10_svg__t_2s" attributeName="transform" type="scale" from="-1 1" to="1 1" begin="prefixIds_10_svg__t_1s.end" dur="0.5s" repeatCount="0"/>
<path class="prefixIds_10_svg_txt__st1" d="M27,0h-37v64C-10,64,27,64.2,27,0z" transform="scale(0.811377 1)">
<animateTransform id="prefixIds_10_svg_txt__t_1s" attributeName="transform" type="scale" from="1 1" to="-1 1" begin="0s; prefixIds_10_svg_txt__t_2s.end" dur="0.5s" repeatCount="0"/>
<animateTransform id="prefixIds_10_svg_txt__t_2s" attributeName="transform" type="scale" from="-1 1" to="1 1" begin="prefixIds_10_svg_txt__t_1s.end" dur="0.5s" repeatCount="0"/>
</path>
</g>
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ prefixIds should correctly handle url()s in style attribute, including multiple

<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="prefixIds_11_svg__fill"/>
<linearGradient id="prefixIds_11_svg__stroke"/>
<linearGradient id="prefixIds_11_svg_txt__fill"/>
<linearGradient id="prefixIds_11_svg_txt__stroke"/>
</defs>
<rect style="fill:url(#prefixIds_11_svg__fill); stroke: url(#prefixIds_11_svg__stroke)" x="10" y="10" width="100" height="100"/>
<rect style="fill:url(#prefixIds_11_svg_txt__fill); stroke: url(#prefixIds_11_svg_txt__stroke)" x="10" y="10" width="100" height="100"/>
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ into multiple nodes due to XML comments.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1">
<style>
<!--uwu-->
#prefixIds_12_svg__a{}
#prefixIds_12_svg_txt__a{}
</style>
</svg>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9e01769

Please sign in to comment.