summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Šulc <fordfrog@gentoo.org>2023-12-08 11:38:42 +0100
committerMiroslav Šulc <fordfrog@gentoo.org>2023-12-08 11:38:57 +0100
commit7accbac256b52711f5f70597ffcb0777b848ad57 (patch)
tree338f802d8331f756f76a4a622ff7280ad767580e /dev-java
parentdev-java/stringtemplate: minor style update (diff)
downloadgentoo-7accbac256b52711f5f70597ffcb0777b848ad57.tar.gz
gentoo-7accbac256b52711f5f70597ffcb0777b848ad57.tar.bz2
gentoo-7accbac256b52711f5f70597ffcb0777b848ad57.zip
dev-java/stringtemplate: fixed tests for java 21 in 4.3.4
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r--dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch118
1 files changed, 34 insertions, 84 deletions
diff --git a/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch b/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch
index e166440edeeb..127f5e0a4b61 100644
--- a/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch
+++ b/dev-java/stringtemplate/files/stringtemplate-4.3.4-Java21-TestRenderers.patch
@@ -1,91 +1,41 @@
-There were 4 failures:
-1) testRendererForGroup(org.stringtemplate.v4.test.TestRenderers)
-org.junit.ComparisonFailure: expected:<...etime: 7/5/05, 12:00[ ]AM> but was:<...etime: 7/5/05, 12:00[ ]AM>
- at org.junit.Assert.assertEquals(Assert.java:117)
- at org.junit.Assert.assertEquals(Assert.java:146)
- at org.stringtemplate.v4.test.TestRenderers.testRendererForGroup(TestRenderers.java:82)
-2) testRendererWithPredefinedFormat2(org.stringtemplate.v4.test.TestRenderers)
-org.junit.ComparisonFailure: expected:<...uesday, July 5, 2005[ at 12:00:00 ]AM Pacific Daylight ...> but was:<...uesday, July 5, 2005[, 12:00:00 ]AM Pacific Daylight ...>
- at org.junit.Assert.assertEquals(Assert.java:117)
- at org.junit.Assert.assertEquals(Assert.java:146)
- at org.stringtemplate.v4.test.TestRenderers.testRendererWithPredefinedFormat2(TestRenderers.java:131)
-3) testRendererWithPredefinedFormat4(org.stringtemplate.v4.test.TestRenderers)
-org.junit.ComparisonFailure: expected:< time: 12:00:00[ ]AM > but was:< time: 12:00:00[ ]AM >
- at org.junit.Assert.assertEquals(Assert.java:117)
- at org.junit.Assert.assertEquals(Assert.java:146)
- at org.stringtemplate.v4.test.TestRenderers.testRendererWithPredefinedFormat4(TestRenderers.java:164)
-4) testRendererWithPredefinedFormat(org.stringtemplate.v4.test.TestRenderers)
-org.junit.ComparisonFailure: expected:<...etime: 7/5/05, 12:00[ ]AM > but was:<...etime: 7/5/05, 12:00[ ]AM >
- at org.junit.Assert.assertEquals(Assert.java:117)
- at org.junit.Assert.assertEquals(Assert.java:146)
- at org.stringtemplate.v4.test.TestRenderers.testRendererWithPredefinedFormat(TestRenderers.java:111)
+there are different space characters used in java 21 (narrow space)
-FAILURES!!!
-Tests run: 636, Failures: 4
-
-https://github.com/antlr/stringtemplate4/issues/315
--- a/stringtemplate4-ST4-4.3.4/test/org/stringtemplate/v4/test/TestRenderers.java
+++ b/stringtemplate4-ST4-4.3.4/test/org/stringtemplate/v4/test/TestRenderers.java
-@@ -30,6 +30,7 @@ package org.stringtemplate.v4.test;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-+import org.junit.Ignore;
- import org.stringtemplate.v4.DateRenderer;
- import org.stringtemplate.v4.NumberRenderer;
- import org.stringtemplate.v4.ST;
-@@ -66,7 +67,7 @@ public class TestRenderers extends BaseTest {
- Locale.setDefault(origLocale);
- }
-
-- @Test public void testRendererForGroup() throws Exception {
-+ @Test @Ignore public void testRendererForGroup() throws Exception {
- String templates =
- "dateThing(created) ::= \"datetime: <created>\"\n";
- writeFile(tmpdir, "t.stg", templates);
-@@ -95,7 +96,7 @@ public class TestRenderers extends BaseTest {
+@@ -77,6 +77,8 @@ public class TestRenderers extends BaseTest {
+ String expecting = "datetime: 7/5/05, 12:00 AM";
+ if ( javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7") || javaVersion.startsWith("1.8") ) {
+ expecting = "datetime: 7/5/05 12:00 AM";
++ } else if ( javaVersion.startsWith("21") ) {
++ expecting = "datetime: 7/5/05, 12:00 AM";
+ }
+ String result = st.render();
assertEquals(expecting, result);
- }
-
-- @Test public void testRendererWithPredefinedFormat() throws Exception {
-+ @Test @Ignore public void testRendererWithPredefinedFormat() throws Exception {
- String templates =
- "dateThing(created) ::= << datetime: <created; format=\"short\"> >>\n";
- writeFile(tmpdir, "t.stg", templates);
-@@ -111,7 +112,7 @@ public class TestRenderers extends BaseTest {
+@@ -106,6 +108,8 @@ public class TestRenderers extends BaseTest {
+ String expecting = " datetime: 7/5/05, 12:00 AM ";
+ if ( javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7") || javaVersion.startsWith("1.8") ) {
+ expecting = " datetime: 7/5/05 12:00 AM ";
++ } else if ( javaVersion.startsWith("21") ) {
++ expecting = " datetime: 7/5/05, 12:00 AM ";
+ }
+ String result = st.render();
assertEquals(expecting, result);
- }
-
-- @Test public void testRendererWithPredefinedFormat2() throws Exception {
-+ @Test @Ignore public void testRendererWithPredefinedFormat2() throws Exception {
- String templates =
- "dateThing(created) ::= << datetime: <created; format=\"full\"> >>\n";
- writeFile(tmpdir, "t.stg", templates);
-@@ -150,7 +151,7 @@ public class TestRenderers extends BaseTest {
+@@ -126,6 +130,8 @@ public class TestRenderers extends BaseTest {
+ String expecting = " datetime: Tuesday, July 5, 2005 at 12:00:00 AM Pacific Daylight Time ";
+ if ( javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7") || javaVersion.startsWith("1.8") ) {
+ expecting = " datetime: Tuesday, July 5, 2005 12:00:00 AM PDT ";
++ } else if ( javaVersion.startsWith("21") ) {
++ expecting = " datetime: Tuesday, July 5, 2005, 12:00:00 AM Pacific Daylight Time ";
+ }
+ String result = st.render();
+ assertEquals(expecting, result);
+@@ -160,6 +166,9 @@ public class TestRenderers extends BaseTest {
+ ST st = group.getInstanceOf("dateThing");
+ st.add("created", new GregorianCalendar(2005, 7 - 1, 5));
+ String expecting = " time: 12:00:00 AM ";
++ if ( javaVersion.startsWith("21") ) {
++ expecting = " time: 12:00:00 AM ";
++ }
+ String result = st.render();
assertEquals(expecting, result);
}
-
-- @Test public void testRendererWithPredefinedFormat4() throws Exception {
-+ @Test @Ignore public void testRendererWithPredefinedFormat4() throws Exception {
- String templates =
- "dateThing(created) ::= << time: <created; format=\"time:medium\"> >>\n";
-
---- a/stringtemplate4-ST4-4.3.4/test/org/stringtemplate/v4/test/TestGroups.java
-+++ b/stringtemplate4-ST4-4.3.4/test/org/stringtemplate/v4/test/TestGroups.java
-@@ -29,6 +29,7 @@ package org.stringtemplate.v4.test;
-
- import org.junit.Assert;
- import org.junit.Test;
-+import org.junit.Ignore;
- import org.stringtemplate.v4.*;
- import org.stringtemplate.v4.misc.ErrorBuffer;
-
-@@ -813,7 +814,7 @@ public class TestGroups extends BaseTest {
- }
-
-
-- @Test public void testGroupStringMultipleThreads() throws Exception {
-+ @Test @Ignore public void testGroupStringMultipleThreads() throws Exception {
- String templates =
- "stat(name,value={99}) ::= \"x=<value>; // <name>\"" + newline;
- final STGroup group = new STGroupString(templates);