File tree Expand file tree Collapse file tree 3 files changed +16
-27
lines changed
src/test/java/org/eolang/lints Expand file tree Collapse file tree 3 files changed +16
-27
lines changed Original file line number Diff line number Diff line change 1212 comment :
1313 timeout-minutes : 15
1414 runs-on : ubuntu-24.04
15+ if : ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
1516 steps :
1617 - name : Dump GitHub context
1718 env :
Original file line number Diff line number Diff line change 7373@ ExtendWith (MktmpResolver .class )
7474final class SourceTest {
7575
76- /**
77- * Single lint for fast tests that only need to verify basic defect detection.
78- */
79- private static final Iterable <Lint <XML >> SINGLE = new ListOf <>(
80- new Unchecked <>(
81- () -> new LtByXsl ("comments/comment-without-dot" )
82- ).value ()
83- );
84-
8576 @ Timeout (unit = TimeUnit .SECONDS , value = 60L )
8677 @ Test
8778 void returnsEmptyListOfDefects () throws IOException {
@@ -154,7 +145,7 @@ void checksSimple(@Mktmp final Path dir) throws IOException {
154145 MatcherAssert .assertThat (
155146 "the defect is found" ,
156147 new Source (
157- new XMLDocument (path ), SourceTest . SINGLE
148+ new XMLDocument (path ), new ListOf <>( new LtByXsl ( "comments/comment-without-dot" ))
158149 ).defects ().size (),
159150 Matchers .greaterThan (0 )
160151 );
@@ -171,7 +162,7 @@ void lintsInMultipleThreads() {
171162 new EoSyntax (
172163 "# Foo\n [] > foo\n "
173164 ).parsed (),
174- SourceTest . SINGLE
165+ new ListOf <>( new LtByXsl ( "comments/comment-without-dot" ))
175166 ).defects ().size ()
176167 ).asList ()
177168 ).size (),
@@ -241,7 +232,7 @@ void doesNotThrowIoException() {
241232 () ->
242233 new Source (
243234 new XMLDocument ("<object><o name='correct'/></object>" ),
244- SourceTest . SINGLE
235+ new ListOf <>( new LtByXsl ( "comments/comment-without-dot" ))
245236 ).defects (),
246237 "Exception was thrown, but it should not be"
247238 );
@@ -392,7 +383,7 @@ void outputsInformationAboutSingleScope() throws IOException {
392383 "[] > foo"
393384 )
394385 ).parsed (),
395- SourceTest . SINGLE
386+ new ListOf <>( new LtByXsl ( "comments/comment-without-dot" ))
396387 ).defects (),
397388 Matchers .hasItem (
398389 Matchers .hasToString (
Original file line number Diff line number Diff line change 3333 */
3434final class WpaLintsTest {
3535
36- /**
37- * WPA lints mapped to their names.
38- */
39- private static final Map <String , Lint <Map <String , XML >>> WPA =
40- new Sticky <>(
41- new MapOf <String , Lint <Map <String , XML >>>(
42- new Mapped <>(
43- wpl -> new MapEntry <>(wpl .name (), wpl ),
44- new WpaLints ()
45- )
46- )
47- );
48-
4936 @ Test
5037 @ SuppressWarnings ("JTCOP.RuleAssertionMessage" )
5138 void staysPackagePrivate () {
@@ -64,7 +51,17 @@ void staysPackagePrivate() {
6451 void testsAllLintsByEo (final String yaml ) throws IOException {
6552 MatcherAssert .assertThat (
6653 "Story failures are not empty, but they should." ,
67- new WpaStory (yaml , WpaLintsTest .WPA ).execute (),
54+ new WpaStory (
55+ yaml ,
56+ new Sticky <>(
57+ new MapOf <String , Lint <Map <String , XML >>>(
58+ new Mapped <>(
59+ wpl -> new MapEntry <>(wpl .name (), wpl ),
60+ new WpaLints ()
61+ )
62+ )
63+ )
64+ ).execute (),
6865 new WpaStoryMatcher ()
6966 );
7067 }
You can’t perform that action at this time.
0 commit comments