1- package io.github.composegears.valkyrie.parser.jvm .svg
1+ package io.github.composegears.valkyrie.sdk.utils .svg
22
33import assertk.assertThat
44import assertk.assertions.contains
@@ -8,7 +8,7 @@ import kotlin.test.Test
88import kotlin.test.assertFalse
99import kotlin.test.assertTrue
1010
11- class SvgManipulatorTest {
11+ class SvgDomModifierTest {
1212
1313 @Test
1414 fun `modifySvg updates root element attribute` () {
@@ -18,7 +18,7 @@ class SvgManipulatorTest {
1818 </svg>
1919 """ .trimIndent()
2020
21- val modifiedSvg = SvgManipulator .modifySvg (originalSvg) { svgElement ->
21+ val modifiedSvg = SvgDomModifier .modify (originalSvg) { svgElement ->
2222 svgElement.setAttribute(" width" , " 48" )
2323 svgElement.setAttribute(" height" , " 48" )
2424 }
@@ -40,8 +40,8 @@ class SvgManipulatorTest {
4040 </svg>
4141 """ .trimIndent()
4242
43- val modifiedSvg = SvgManipulator .modifySvg (originalSvg) { svgElement ->
44- SvgManipulator .updateAttributeRecursively(
43+ val modifiedSvg = SvgDomModifier .modify (originalSvg) { svgElement ->
44+ SvgDomModifier .updateAttributeRecursively(
4545 element = svgElement,
4646 attributeName = " stroke-width" ,
4747 newValue = " 3" ,
@@ -64,8 +64,8 @@ class SvgManipulatorTest {
6464 </svg>
6565 """ .trimIndent()
6666
67- val modifiedSvg = SvgManipulator .modifySvg (originalSvg) { svgElement ->
68- SvgManipulator .updateAttributeRecursively(
67+ val modifiedSvg = SvgDomModifier .modify (originalSvg) { svgElement ->
68+ SvgDomModifier .updateAttributeRecursively(
6969 element = svgElement,
7070 attributeName = " stroke-width" ,
7171 newValue = " 3" ,
@@ -86,8 +86,8 @@ class SvgManipulatorTest {
8686 </svg>
8787 """ .trimIndent()
8888
89- val modifiedSvg = SvgManipulator .modifySvg (originalSvg) { svgElement ->
90- SvgManipulator .updateAttributeConditionally(
89+ val modifiedSvg = SvgDomModifier .modify (originalSvg) { svgElement ->
90+ SvgDomModifier .updateAttributeConditionally(
9191 element = svgElement,
9292 attributeName = " stroke" ,
9393 currentValue = " currentColor" ,
@@ -118,8 +118,8 @@ class SvgManipulatorTest {
118118 </svg>
119119 """ .trimIndent()
120120
121- val modifiedSvg = SvgManipulator .modifySvg (originalSvg) { svgElement ->
122- SvgManipulator .updateAttributeRecursively(
121+ val modifiedSvg = SvgDomModifier .modify (originalSvg) { svgElement ->
122+ SvgDomModifier .updateAttributeRecursively(
123123 element = svgElement,
124124 attributeName = " stroke-width" ,
125125 newValue = " 5" ,
@@ -138,7 +138,7 @@ class SvgManipulatorTest {
138138 </svg>
139139 """ .trimIndent()
140140
141- val modifiedSvg = SvgManipulator .modifySvg (originalSvg) { svgElement ->
141+ val modifiedSvg = SvgDomModifier .modify (originalSvg) { svgElement ->
142142 svgElement.setAttribute(" width" , " 48" )
143143 }
144144
@@ -153,7 +153,7 @@ class SvgManipulatorTest {
153153 </svg>
154154 """ .trimIndent()
155155
156- val modifiedSvg = SvgManipulator .modifySvg (originalSvg) { svgElement ->
156+ val modifiedSvg = SvgDomModifier .modify (originalSvg) { svgElement ->
157157 svgElement.setAttribute(" width" , " 48" )
158158 }
159159
@@ -164,7 +164,7 @@ class SvgManipulatorTest {
164164 fun `modifySvg returns original content on parse failure` () {
165165 val invalidSvg = " This is not valid XML"
166166
167- val result = SvgManipulator .modifySvg (invalidSvg) { svgElement ->
167+ val result = SvgDomModifier .modify (invalidSvg) { svgElement ->
168168 svgElement.setAttribute(" width" , " 48" )
169169 }
170170
@@ -180,7 +180,7 @@ class SvgManipulatorTest {
180180 </svg>
181181 """ .trimIndent()
182182
183- val modifiedSvg = SvgManipulator .modifySvg (originalSvg) { svgElement ->
183+ val modifiedSvg = SvgDomModifier .modify (originalSvg) { svgElement ->
184184 svgElement.setAttribute(" width" , " 48" )
185185 }
186186
@@ -200,8 +200,8 @@ class SvgManipulatorTest {
200200 </svg>
201201 """ .trimIndent()
202202
203- val modifiedSvg = SvgManipulator .modifySvg (originalSvg) { svgElement ->
204- SvgManipulator .updateAttributeRecursively(
203+ val modifiedSvg = SvgDomModifier .modify (originalSvg) { svgElement ->
204+ SvgDomModifier .updateAttributeRecursively(
205205 element = svgElement,
206206 attributeName = " stroke-width" ,
207207 newValue = " 2" ,
@@ -220,17 +220,17 @@ class SvgManipulatorTest {
220220 </svg>
221221 """ .trimIndent()
222222
223- val modifiedSvg = SvgManipulator .modifySvg (lucideSvg) { svgElement ->
223+ val modifiedSvg = SvgDomModifier .modify (lucideSvg) { svgElement ->
224224 svgElement.setAttribute(" width" , " 48" )
225225 svgElement.setAttribute(" height" , " 48" )
226226
227- SvgManipulator .updateAttributeRecursively(
227+ SvgDomModifier .updateAttributeRecursively(
228228 element = svgElement,
229229 attributeName = " stroke-width" ,
230230 newValue = " 3" ,
231231 )
232232
233- SvgManipulator .updateAttributeConditionally(
233+ SvgDomModifier .updateAttributeConditionally(
234234 element = svgElement,
235235 attributeName = " stroke" ,
236236 currentValue = " currentColor" ,
0 commit comments