String comparison tests on exception messages keep failing due to >'< character keeps getting removed!

2024-05-13 Thread Tommy Svensson
Here is a test I have been forced to comment out since it is 100% impossible to make work due to  '  character keeps getting removed!         assert se3.message == "'" +"LAZY DEVELOPER! This is a test" + "'"                      No matter what you do here the result will be:                 Ass

Re: String comparison tests on exception messages keep failing due to >'< character keeps getting removed!

2024-05-13 Thread Søren Berg Glasius
Hi Tommy, This works: class Library { boolean someLibraryMethod() { throw new RuntimeException("'" + "LAZY DEVELOPER! This is a test" + "'") } boolean someOtherLibraryMethod() { throw new RuntimeException("'LAZY DEVELOPER! This is a test'") } } class LibraryTest e

Re: String comparison tests on exception messages keep failing due to >'< character keeps getting removed!

2024-05-13 Thread OCsite
Tommy, I am afraid I do not quite follow you. The assert seems to work all right, far as I can say: === 1029 ocs /tmp> /usr/local/groovy-4.0.21/bin/groovy q all ok 1031 ocs /tmp> === Do I overlook something of importance here? All the best, OC > On 13. 5. 2024, at 18:45, Tommy Svensson wro

Re: String comparison tests on exception messages keep failing due to >'< character keeps getting removed!

2024-05-13 Thread Spencer Allain via users
While I don't know exactly what the se3 object is, I suspect it has a String message property, and the toString() method displays the content of the String, such as below. Object se3 = new Object() {    String message    String toString() { message }} se3.message = 'LAZY DEVELOPER! This is a Tes