|
1 | 1 | /*
|
2 |
| - * Copyright 2016-2023 DiffPlug |
| 2 | + * Copyright 2016-2024 DiffPlug |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -29,69 +29,55 @@ void works0_48_0() {
|
29 | 29 | FormatterStep step = KtLintStep.create("0.48.0", TestProvisioner.mavenCentral());
|
30 | 30 | StepHarnessWithFile.forStep(this, step)
|
31 | 31 | .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic-old.clean")
|
32 |
| - .testResourceExceptionMsg("kotlin/ktlint/unsolvable.dirty").isEqualTo("Error on line: 1, column: 1\n" + |
33 |
| - "rule: no-wildcard-imports\n" + |
34 |
| - "Wildcard import"); |
| 32 | + .expectLintsOfResource("kotlin/ktlint/unsolvable.dirty").toBe("L1 ktlint(no-wildcard-imports) Wildcard import"); |
35 | 33 | }
|
36 | 34 |
|
37 | 35 | @Test
|
38 | 36 | void works0_48_1() {
|
39 | 37 | FormatterStep step = KtLintStep.create("0.48.1", TestProvisioner.mavenCentral());
|
40 | 38 | StepHarnessWithFile.forStep(this, step)
|
41 | 39 | .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic-old.clean")
|
42 |
| - .testResourceExceptionMsg("kotlin/ktlint/unsolvable.dirty").isEqualTo("Error on line: 1, column: 1\n" + |
43 |
| - "rule: no-wildcard-imports\n" + |
44 |
| - "Wildcard import"); |
| 40 | + .expectLintsOfResource("kotlin/ktlint/unsolvable.dirty").toBe("L1 ktlint(no-wildcard-imports) Wildcard import"); |
45 | 41 | }
|
46 | 42 |
|
47 | 43 | @Test
|
48 | 44 | void works0_49_0() {
|
49 | 45 | FormatterStep step = KtLintStep.create("0.49.0", TestProvisioner.mavenCentral());
|
50 | 46 | StepHarnessWithFile.forStep(this, step)
|
51 | 47 | .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic-old.clean")
|
52 |
| - .testResourceExceptionMsg("kotlin/ktlint/unsolvable.dirty").isEqualTo("Error on line: 1, column: 1\n" + |
53 |
| - "rule: standard:no-wildcard-imports\n" + |
54 |
| - "Wildcard import"); |
| 48 | + .expectLintsOfResource("kotlin/ktlint/unsolvable.dirty").toBe("L1 ktlint(standard:no-wildcard-imports) Wildcard import"); |
55 | 49 | }
|
56 | 50 |
|
57 | 51 | @Test
|
58 | 52 | void works0_49_1() {
|
59 | 53 | FormatterStep step = KtLintStep.create("0.49.1", TestProvisioner.mavenCentral());
|
60 | 54 | StepHarnessWithFile.forStep(this, step)
|
61 | 55 | .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic-old.clean")
|
62 |
| - .testResourceExceptionMsg("kotlin/ktlint/unsolvable.dirty").isEqualTo("Error on line: 1, column: 1\n" + |
63 |
| - "rule: standard:no-wildcard-imports\n" + |
64 |
| - "Wildcard import"); |
| 56 | + .expectLintsOfResource("kotlin/ktlint/unsolvable.dirty").toBe("L1 ktlint(standard:no-wildcard-imports) Wildcard import"); |
65 | 57 | }
|
66 | 58 |
|
67 | 59 | @Test
|
68 | 60 | void works0_50_0() {
|
69 | 61 | FormatterStep step = KtLintStep.create("0.50.0", TestProvisioner.mavenCentral());
|
70 | 62 | StepHarnessWithFile.forStep(this, step)
|
71 | 63 | .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic.clean")
|
72 |
| - .testResourceExceptionMsg("kotlin/ktlint/unsolvable.dirty").isEqualTo("Error on line: 1, column: 1\n" + |
73 |
| - "rule: standard:no-wildcard-imports\n" + |
74 |
| - "Wildcard import"); |
| 64 | + .expectLintsOfResource("kotlin/ktlint/unsolvable.dirty").toBe("L1 ktlint(standard:no-wildcard-imports) Wildcard import"); |
75 | 65 | }
|
76 | 66 |
|
77 | 67 | @Test
|
78 | 68 | void works1_0_0() {
|
79 | 69 | FormatterStep step = KtLintStep.create("1.0.0", TestProvisioner.mavenCentral());
|
80 | 70 | StepHarnessWithFile.forStep(this, step)
|
81 | 71 | .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic.clean")
|
82 |
| - .testResourceExceptionMsg("kotlin/ktlint/unsolvable.dirty").isEqualTo("Error on line: 1, column: 1\n" + |
83 |
| - "rule: standard:no-empty-file\n" + |
84 |
| - "File 'unsolvable.dirty' should not be empty"); |
| 72 | + .expectLintsOfResource("kotlin/ktlint/unsolvable.dirty").toBe("L1 ktlint(standard:no-empty-file) File 'unsolvable.dirty' should not be empty"); |
85 | 73 | }
|
86 | 74 |
|
87 | 75 | @Test
|
88 | 76 | void behavior() {
|
89 | 77 | FormatterStep step = KtLintStep.create(TestProvisioner.mavenCentral());
|
90 | 78 | StepHarnessWithFile.forStep(this, step)
|
91 | 79 | .testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic.clean")
|
92 |
| - .testResourceExceptionMsg("kotlin/ktlint/unsolvable.dirty").isEqualTo("Error on line: 1, column: 1\n" + |
93 |
| - "rule: standard:no-empty-file\n" + |
94 |
| - "File 'unsolvable.dirty' should not be empty"); |
| 80 | + .expectLintsOfResource("kotlin/ktlint/unsolvable.dirty").toBe("L1 ktlint(standard:no-empty-file) File 'unsolvable.dirty' should not be empty"); |
95 | 81 | }
|
96 | 82 |
|
97 | 83 | @Test
|
|
0 commit comments