Skip to content

test SQLTokenizedFormatter to separate the concerns#2523

Closed
Pankraz76 wants to merge 21 commits intodiffplug:mainfrom
Pankraz76:fix-lineSeparatorfix-PomExtension
Closed

test SQLTokenizedFormatter to separate the concerns#2523
Pankraz76 wants to merge 21 commits intodiffplug:mainfrom
Pankraz76:fix-lineSeparatorfix-PomExtension

Conversation

@Pankraz76
Copy link
Copy Markdown

@Pankraz76 Pankraz76 commented Jun 24, 2025

having string blocks """ would help when testing format:

image

assuming it would be possible the c&p the war diff then into the block remaining every format.



Reusing configuration cache.
> Task :lib:processTestResources NO-SOURCE
> Task :lib:processResources UP-TO-DATE
> Task :lib:compileJava UP-TO-DATE
> Task :lib:classes UP-TO-DATE
> Task :lib:compileTestJava
> Task :lib:testClasses

<Click to see difference>

org.opentest4j.AssertionFailedError: 
expected: 
  "SELECT u.name, COUNT(o.id)
  FROM users u
  LEFT JOIN orders o
      ON u.id = o.user_id
  WHERE u.age > 18
  GROUP BY u.name
  HAVING COUNT(o.id) > 5
  ORDER BY u.name"
 but was: 
  "SELECT
      u.name,
      COUNT( o.id )
  FROM
      users u
  LEFT JOIN orders o ON
      u.id = o.user_id
  WHERE
      u.age > 18
  GROUP BY
      u.name
  HAVING
      COUNT( o.id )> 5
  ORDER BY
      u.name"
	at com.diffplug.spotless.sql.dbeaver.SQLTokenizedFormatterTest.testComplexQuery(SQLTokenizedFormatterTest.java:133)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)


> Task :lib:test FAILED
�[0K�[1mcom.diffplug.spotless.sql.dbeaver.SQLTokenizedFormatterTest�[22m testComplexQuery()�[31m FAILED�[31m
  org.opentest4j.AssertionFailedError: 
  expected: 
    "SELECT u.name, COUNT(o.id)
    FROM users u
    LEFT JOIN orders o
        ON u.id = o.user_id
    WHERE u.age > 18
    GROUP BY u.name
    HAVING COUNT(o.id) > 5
    ORDER BY u.name"
   but was: 
    "SELECT
        u.name,
        COUNT( o.id )
    FROM
        users u
    LEFT JOIN orders o ON
        u.id = o.user_id
    WHERE
        u.age > 18
    GROUP BY
        u.name
    HAVING
        COUNT( o.id )> 5
    ORDER BY
        u.name"
      at app//com.diffplug.spotless.sql.dbeaver.SQLTokenizedFormatterTest.testComplexQuery(SQLTokenizedFormatterTest.java:133)
�[m
�[0K�[1;31mFAILURE: �[39mExecuted 1 tests in 521ms (1 failed)�[m
1 test completed, 1 failed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':lib:test'.
> There were failing tests. See the report at: file:///Users/vincent.potucek/IdeaProjects/spotless/lib/build/reports/tests/test/index.html
BUILD FAILED in 798ms
4 actionable tasks: 2 executed, 2 up-to-date
Configuration cache entry reused.

Vincent Potucek added 20 commits June 23, 2025 22:09
# Conflicts:
#	lib/src/test/java/com/diffplug/spotless/pom/SortPomCfgTest.java
# Conflicts:
#	lib/src/test/java/com/diffplug/spotless/pom/SortPomCfgTest.java
@Pankraz76 Pankraz76 changed the title Fix line separatorfix pom extension test: SQLTokenizedFormatter Jun 24, 2025
@Pankraz76 Pankraz76 changed the title test: SQLTokenizedFormatter test SQLTokenizedFormatter to separate the concerns Jun 24, 2025
@Pankraz76 Pankraz76 closed this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant