Skip to content

Commit

Permalink
Add indent to baseline tests for easier comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbrooks committed Jun 2, 2021
1 parent d72cb42 commit f025250
Show file tree
Hide file tree
Showing 17 changed files with 1,308 additions and 20 deletions.
8 changes: 4 additions & 4 deletions vgo/src/test/kotlin/com/jzbrooks/vgo/BaselineTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BaselineTests {
val inputFile = unoptimizedAsset.toFile()
val inputFileName = inputFile.name.substring(0, inputFile.name.lastIndexOf('.'))
val outputFilePath = "build/test-results/${inputFileName}_testOptimizationFinishes.${inputFile.extension}"
val arguments = arrayOf(unoptimizedAsset.toString(), "-o", outputFilePath)
val arguments = arrayOf(unoptimizedAsset.toString(), "-o", outputFilePath, "--indent", "2")

val exitCode = Application().run(arguments)

Expand All @@ -33,7 +33,7 @@ class BaselineTests {
val inputFile = unoptimizedAsset.toFile()
val inputFileName = inputFile.name.substring(0, inputFile.name.lastIndexOf('.'))
val outputFilePath = "build/test-results/${inputFileName}_testOptimizedAssetIsEquivalentToBaseline.${inputFile.extension}"
val arguments = arrayOf(unoptimizedAsset.toString(), "-o", outputFilePath)
val arguments = arrayOf(unoptimizedAsset.toString(), "-o", outputFilePath, "--indent", "2")

Application().run(arguments)

Expand All @@ -48,7 +48,7 @@ class BaselineTests {
val inputFile = unoptimizedAsset.toFile()
val inputFileName = inputFile.name.substring(0, inputFile.name.lastIndexOf('.'))
val outputFilePath = "build/test-results/${inputFileName}_testOptimizedAssetIsNotLargerThanBaseline.${inputFile.extension}"
val arguments = arrayOf(unoptimizedAsset.toString(), "-o", outputFilePath)
val arguments = arrayOf(unoptimizedAsset.toString(), "-o", outputFilePath, "--indent", "2")

Application().run(arguments)

Expand All @@ -64,7 +64,7 @@ class BaselineTests {
val inputFile = unoptimizedAsset.toFile()
val inputFileName = inputFile.name.substring(0, inputFile.name.lastIndexOf('.'))
val outputFilePath = "build/test-results/${inputFileName}_testOptimizedAssetIsNotLargerThanOriginal.${inputFile.extension}"
val arguments = arrayOf(unoptimizedAsset.toString(), "-o", outputFilePath)
val arguments = arrayOf(unoptimizedAsset.toString(), "-o", outputFilePath, "--indent", "2")

Application().run(arguments)

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="108dp" android:viewportHeight="108" android:viewportWidth="108" android:width="108dp"><path android:fillColor="#26a69a" android:pathData="M0,0h108v108H0Z"/><path android:pathData="M-13.5,-27v162M1.5,-27v162M16.5,-27v162M31.5,-27v162M46.5,-27v162M61.5,-27v162M69,0v108M79,0v108M89,0v108M99,0v108M162,153H54M162,143H54M162,133H54M162,123H54M162,113H54M162,103H54M54,123h108M54,133h108M54,143h108M54,153h108M73,83h70M73,93h70M73,103h70M73,113h70M73,123h70M73,133h70M83,73v70M93,73v70M103,73v70M113,73v70M123,73v70M133,73v70" android:strokeColor="#33ffffff" android:strokeWidth="0.8"/></vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="108dp" android:viewportHeight="108" android:viewportWidth="108" android:width="108dp">
<path android:fillColor="#26a69a" android:pathData="M0,0h108v108H0Z"/>
<path android:pathData="M-13.5,-27v162M1.5,-27v162M16.5,-27v162M31.5,-27v162M46.5,-27v162M61.5,-27v162M69,0v108M79,0v108M89,0v108M99,0v108M162,153H54M162,143H54M162,133H54M162,123H54M162,113H54M162,103H54M54,123h108M54,133h108M54,143h108M54,153h108M73,83h70M73,93h70M73,103h70M73,113h70M73,123h70M73,133h70M83,73v70M93,73v70M103,73v70M113,73v70M123,73v70M133,73v70" android:strokeColor="#33ffffff" android:strokeWidth="0.8"/>
</vector>
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp"><group android:name="rotationGroup"><path android:fillColor="#4d000000" android:name="vect" android:pathData="M17.03,5.672 15.417,5.24l0.518,-1.932L12.071,2.273l-0.518,1.932L9.94,3.772a1.336,1.336,0,0,0,-1.629,0.94l-0.95,3.545 4.762,1.276 1.551,-1.655-0.518,1.932 3.864,1.035 0.95,-3.545A1.336,1.336,0,0,0,17.03,5.672"/><path android:fillColor="#000" android:name="draw" android:pathData="M12.251,13.191l1.932,0.518-5.805,6.209 1.424,-5.313L7.869,14.088l4.254,-4.554L7.361,8.258 4.341,19.53a1.336,1.336,0,0,0,0.94,1.629l7.08,1.897A1.338,1.338,0,0,0,14,22.118l3.02,-11.272L13.157,9.811l-0.906,3.381"/></group></vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
<group android:name="rotationGroup">
<path android:fillColor="#4d000000" android:name="vect" android:pathData="M17.03,5.672 15.417,5.24l0.518,-1.932L12.071,2.273l-0.518,1.932L9.94,3.772a1.336,1.336,0,0,0,-1.629,0.94l-0.95,3.545 4.762,1.276 1.551,-1.655-0.518,1.932 3.864,1.035 0.95,-3.545A1.336,1.336,0,0,0,17.03,5.672"/>
<path android:fillColor="#000" android:name="draw" android:pathData="M12.251,13.191l1.932,0.518-5.805,6.209 1.424,-5.313L7.869,14.088l4.254,-4.554L7.361,8.258 4.341,19.53a1.336,1.336,0,0,0,0.94,1.629l7.08,1.897A1.338,1.338,0,0,0,14,22.118l3.02,-11.272L13.157,9.811l-0.906,3.381"/>
</group>
</vector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="100dp" android:viewportHeight="100" android:viewportWidth="100" android:width="100dp"><path android:fillColor="#444" android:fillType="evenOdd" android:pathData="M50,0C22.397,0 0,22.397 0,50c0,27.603 22.397,50 50,50 27.549,0 50,-22.397 50,-50C100,22.397 77.549,0 50,0Zm33.026,23.048a42.512,42.512,0,0,1,9.653,26.573c-1.41,-0.271-15.51,-3.145-29.718,-1.356C62.636,47.56 62.364,46.8 62.039,46.041a127.096,127.096,0,0,0,-2.82,-6.182C74.946,33.46 82.104,24.241 83.026,23.048ZM50,7.375a42.611,42.611,0,0,1,28.308,10.738c-0.759,1.085-7.213,9.707-22.397,15.401C48.915,20.662 41.16,10.141 39.967,8.514A43.431,43.431,0,0,1,50,7.375Zm-18.167,4.013a269.496,269.496,0,0,1,15.835,24.675c-19.957,5.314-37.581,5.206-39.479,5.206A42.906,42.906,0,0,1,31.833,11.388ZM7.267,50.054l0,-1.301c1.844,0.054 22.56,0.325 43.872,-6.074a127.033,127.033,0,0,1,3.471,7.267c-0.542,0.163-1.139,0.325-1.681,0.488-22.017,7.104-33.731,26.519-34.707,28.145A42.608,42.608,0,0,1,7.267,50.054ZM50,92.733c-9.87,0-18.98,-3.362-26.193,-9.002C24.566,82.158 33.243,65.455 57.321,57.05c0.109,-0.054 0.163,-0.054 0.271,-0.109a176.543,176.543,0,0,1,9.111,32.375A42.003,42.003,0,0,1,50,92.733Zm23.807,-7.321A183.744,183.744,0,0,0,65.51,54.989c13.395,-2.115 25.108,1.356 26.573,1.844A42.341,42.341,0,0,1,73.807,85.412Z"/></vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="100dp" android:viewportHeight="100" android:viewportWidth="100" android:width="100dp">
<path android:fillColor="#444" android:fillType="evenOdd" android:pathData="M50,0C22.397,0 0,22.397 0,50c0,27.603 22.397,50 50,50 27.549,0 50,-22.397 50,-50C100,22.397 77.549,0 50,0Zm33.026,23.048a42.512,42.512,0,0,1,9.653,26.573c-1.41,-0.271-15.51,-3.145-29.718,-1.356C62.636,47.56 62.364,46.8 62.039,46.041a127.096,127.096,0,0,0,-2.82,-6.182C74.946,33.46 82.104,24.241 83.026,23.048ZM50,7.375a42.611,42.611,0,0,1,28.308,10.738c-0.759,1.085-7.213,9.707-22.397,15.401C48.915,20.662 41.16,10.141 39.967,8.514A43.431,43.431,0,0,1,50,7.375Zm-18.167,4.013a269.496,269.496,0,0,1,15.835,24.675c-19.957,5.314-37.581,5.206-39.479,5.206A42.906,42.906,0,0,1,31.833,11.388ZM7.267,50.054l0,-1.301c1.844,0.054 22.56,0.325 43.872,-6.074a127.033,127.033,0,0,1,3.471,7.267c-0.542,0.163-1.139,0.325-1.681,0.488-22.017,7.104-33.731,26.519-34.707,28.145A42.608,42.608,0,0,1,7.267,50.054ZM50,92.733c-9.87,0-18.98,-3.362-26.193,-9.002C24.566,82.158 33.243,65.455 57.321,57.05c0.109,-0.054 0.163,-0.054 0.271,-0.109a176.543,176.543,0,0,1,9.111,32.375A42.003,42.003,0,0,1,50,92.733Zm23.807,-7.321A183.744,183.744,0,0,0,65.51,54.989c13.395,-2.115 25.108,1.356 26.573,1.844A42.341,42.341,0,0,1,73.807,85.412Z"/>
</vector>
246 changes: 245 additions & 1 deletion vgo/src/test/resources/baseline/eleven_below_single_optimized.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 110 additions & 1 deletion vgo/src/test/resources/baseline/eleven_below_single_optimized.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vgo/src/test/resources/baseline/guacamole_optimized.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f025250

Please sign in to comment.