Skip to content

Commit 99ca046

Browse files
refactor(#985): inline NAME constant with literal "name" in tests
1 parent 7ca08a3 commit 99ca046

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

src/test/java/org/eolang/lints/LtByXslTest.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@
5959
@SuppressWarnings("PMD.TooManyMethods")
6060
final class LtByXslTest {
6161

62-
/**
63-
* XML attribute name.
64-
*/
65-
private static final String NAME = "name";
66-
6762
@Test
6863
void producesExpectedXmirWithFix() throws Exception {
6964
final FixPack pack = new FixPack(
@@ -253,10 +248,10 @@ void checksRedundantObjectLintOnLargeXmirInReasonableTime() {
253248
final int count = 2000;
254249
final Directives dirs = new Directives()
255250
.add("object")
256-
.add("o").attr(LtByXslTest.NAME, "root");
251+
.add("o").attr("name", "root");
257252
for (int idx = 0; idx < count; idx += 1) {
258253
dirs.add("o")
259-
.attr(LtByXslTest.NAME, String.format("obj%d", idx))
254+
.attr("name", String.format("obj%d", idx))
260255
.attr("base", String.format("ξ.obj%d", (idx + 1) % count))
261256
.up();
262257
}
@@ -276,7 +271,7 @@ void checksDuplicateAsAttributeLintOnLargeXmirInReasonableTime()
276271
final int args = 500;
277272
final Directives dirs = new Directives().add("object");
278273
for (int parent = 0; parent < parents; parent += 1) {
279-
dirs.add("o").attr(LtByXslTest.NAME, String.format("obj%d", parent));
274+
dirs.add("o").attr("name", String.format("obj%d", parent));
280275
for (int arg = 0; arg < args; arg += 1) {
281276
dirs.add("o")
282277
.attr("base", String.format("Φ.f%d", arg))
@@ -302,7 +297,7 @@ void checksManyVoidAttributesLintOnLargeXmirInReasonableTime()
302297
final int depth = 5;
303298
final Directives dirs = new Directives().add("object");
304299
for (int parent = 0; parent < parents; parent += 1) {
305-
dirs.add("o").attr(LtByXslTest.NAME, String.format("obj%d", parent));
300+
dirs.add("o");
306301
for (int idx = 0; idx < voids; idx += 1) {
307302
LtByXslTest.voidAttr(dirs, String.format("a%d", idx), depth);
308303
}
@@ -390,7 +385,7 @@ private static void voidAttr(
390385
final String name,
391386
final int children
392387
) throws ImpossibleModificationException {
393-
dirs.add("o").attr(LtByXslTest.NAME, name).attr("base", "∅");
388+
dirs.add("o").attr("name", name).attr("base", "∅");
394389
for (int idx = 0; idx < children; idx += 1) {
395390
dirs.add("o").attr("base", String.format("Φ.f%d", idx)).up();
396391
}

0 commit comments

Comments
 (0)