http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.f3ac new file mode 100644 index 0000000..8c36cbf --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.f3ac @@ -0,0 +1,146 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<head> +<title>FreeMarker: Boolean Values Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>${message}</p> + +<#assign b=true> + +<p>Now perform boolean tests:</p> + +<p><#if b> + b is true.<br /> +<#else> + b is false.<br /> +</#if></p> + +<p><#if false> + This can't be!<br /> +<#else> + This makes sense.<br /> +</#if></p> + +<p><#if boolean3> + boolean3 succeeded.<br /> +<#else> + boolean3 failed.<br /> +</#if></p> + +<p><#if boolean4> + boolean4 succeeded.<br /> +<#else> + boolean4 failed.<br /> +</#if></p> + +<p><#if boolean4 || boolean5> + boolean4 || boolean5 succeeded.<br /> +<#else> + boolean4 || boolean5 failed.<br /> +</#if></p> + +<p><#if boolean5 || boolean4 || boolean5> + boolean5 || boolean4 || boolean5 succeeded.<br /> +<#else> + boolean5 || boolean4 || boolean5 failed.<br /> +</#if></p> + +<p><#if boolean4 && boolean5> + boolean4 && boolean5 succeeded.<br /> +<#else> + boolean4 && boolean5 failed.<br /> +</#if></p> +<@assert true && true /> +<@assert !(false && true) /> +<@assert true and true /> +<@assert !(false and true) /> + +<p>Now test list models:</p> + +<p><#if list1??> + list1 succeeded.<br /> +<#else> + list1 failed.<br /> +</#if></p> + +<p><#if list2??> + list2 succeeded.<br /> +<#else> + list2 failed.<br /> +</#if></p> + +<p>Test hash models:</p> + +<p><#if hash1??> + hash1 succeeded: ${hash1.temp}<br /> +<#else> + hash1 failed: ${hash1.temp}<br /> +</#if></p> + +<p><#if hash2??> + hash2 succeeded.<br /> +<#else> + hash2 failed.<br /> +</#if></p> + +<p>Test not operator:</p> + +<p><#if ! boolean1> + Not boolean1 succeeded +<#else> + Not boolean1 failed +</#if></p> + +<p><#if !boolean1> + Not boolean1 succeeded +<#else> + Not boolean1 failed +</#if></p> + +<p><#if ! boolean2> + Not boolean2 succeeded +<#else> + Not boolean2 failed +</#if></p> + +<p><#if !boolean2> + Not boolean2 succeeded +<#else> + Not boolean2 failed +</#if></p> + +<p><#if message == "Hello, world!"> + Message is "Hello, world!" +<#else> + Message is something else (${message}) +</#if></p> + +<p><#if message != "Hello, world!"> + Message is not "Hello, world!" -- it's ${message} +<#else> + Message is "Hello, world!" +</#if></p> + +</body> +</html>
http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.ftl deleted file mode 100644 index 8c36cbf..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/boolean.ftl +++ /dev/null @@ -1,146 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<head> -<title>FreeMarker: Boolean Values Test</title> -</head> -<body> - -<p>A simple test follows:</p> - -<p>${message}</p> - -<#assign b=true> - -<p>Now perform boolean tests:</p> - -<p><#if b> - b is true.<br /> -<#else> - b is false.<br /> -</#if></p> - -<p><#if false> - This can't be!<br /> -<#else> - This makes sense.<br /> -</#if></p> - -<p><#if boolean3> - boolean3 succeeded.<br /> -<#else> - boolean3 failed.<br /> -</#if></p> - -<p><#if boolean4> - boolean4 succeeded.<br /> -<#else> - boolean4 failed.<br /> -</#if></p> - -<p><#if boolean4 || boolean5> - boolean4 || boolean5 succeeded.<br /> -<#else> - boolean4 || boolean5 failed.<br /> -</#if></p> - -<p><#if boolean5 || boolean4 || boolean5> - boolean5 || boolean4 || boolean5 succeeded.<br /> -<#else> - boolean5 || boolean4 || boolean5 failed.<br /> -</#if></p> - -<p><#if boolean4 && boolean5> - boolean4 && boolean5 succeeded.<br /> -<#else> - boolean4 && boolean5 failed.<br /> -</#if></p> -<@assert true && true /> -<@assert !(false && true) /> -<@assert true and true /> -<@assert !(false and true) /> - -<p>Now test list models:</p> - -<p><#if list1??> - list1 succeeded.<br /> -<#else> - list1 failed.<br /> -</#if></p> - -<p><#if list2??> - list2 succeeded.<br /> -<#else> - list2 failed.<br /> -</#if></p> - -<p>Test hash models:</p> - -<p><#if hash1??> - hash1 succeeded: ${hash1.temp}<br /> -<#else> - hash1 failed: ${hash1.temp}<br /> -</#if></p> - -<p><#if hash2??> - hash2 succeeded.<br /> -<#else> - hash2 failed.<br /> -</#if></p> - -<p>Test not operator:</p> - -<p><#if ! boolean1> - Not boolean1 succeeded -<#else> - Not boolean1 failed -</#if></p> - -<p><#if !boolean1> - Not boolean1 succeeded -<#else> - Not boolean1 failed -</#if></p> - -<p><#if ! boolean2> - Not boolean2 succeeded -<#else> - Not boolean2 failed -</#if></p> - -<p><#if !boolean2> - Not boolean2 succeeded -<#else> - Not boolean2 failed -</#if></p> - -<p><#if message == "Hello, world!"> - Message is "Hello, world!" -<#else> - Message is something else (${message}) -</#if></p> - -<p><#if message != "Hello, world!"> - Message is not "Hello, world!" -- it's ${message} -<#else> - Message is "Hello, world!" -</#if></p> - -</body> -</html> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.f3ac new file mode 100644 index 0000000..956c6fd --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.f3ac @@ -0,0 +1,27 @@ +<#ftl encoding="ISO-8859-2"> +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<head> + <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> +</head> +<body> +���� +<#include "charset-in-header_inc1.f3ac"> +<#include "charset-in-header_inc2.f3ac"> +</body> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.ftl deleted file mode 100644 index 638f4b9..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header.ftl +++ /dev/null @@ -1,27 +0,0 @@ -<#ftl encoding="ISO-8859-2"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<head> - <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> -</head> -<body> -���� -<#include "charset-in-header_inc1.ftl"> -<#include "charset-in-header_inc2.ftl"> -</body> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.f3ac new file mode 100644 index 0000000..b8dc608 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.f3ac @@ -0,0 +1,20 @@ +<#ftl encoding="ISO-8859-1"> +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +���� http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.ftl deleted file mode 100644 index b8dc608..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc1.ftl +++ /dev/null @@ -1,20 +0,0 @@ -<#ftl encoding="ISO-8859-1"> -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -���� http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.f3ac new file mode 100644 index 0000000..66100ec --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.f3ac @@ -0,0 +1,19 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +ÅÅűŰ http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.ftl deleted file mode 100644 index 66100ec..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/charset-in-header_inc2.ftl +++ /dev/null @@ -1,19 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -ÅÅűŰ http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.f3ac new file mode 100644 index 0000000..8cd45c5 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.f3ac @@ -0,0 +1,50 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<head> +<title>FreeMarker: Comment Test</title> +</head> +<body> +<#-- + +A simple test follows: + +${message} + +A more rigorous test, showing that we're not faking it: + +${message@#$%&} + +--><#-- > --><#-- -> --><#-- -- --><#-- -- > --> +<#if message??> + <p>Message exists! + <#-- + ...and even generates output! + --> + </p> +</#if> + +a <#-- < --> b +a <#-- </#noParse> - -- --> b + +${1 + 2 + [#-- c --] <#-- c --> <!-- c --> 3} +${<!-- > -> -- #> #] --> 7} +${<#-- glitch... --] 8} +</body> +</html> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.ftl deleted file mode 100644 index 8cd45c5..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comment.ftl +++ /dev/null @@ -1,50 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<head> -<title>FreeMarker: Comment Test</title> -</head> -<body> -<#-- - -A simple test follows: - -${message} - -A more rigorous test, showing that we're not faking it: - -${message@#$%&} - ---><#-- > --><#-- -> --><#-- -- --><#-- -- > --> -<#if message??> - <p>Message exists! - <#-- - ...and even generates output! - --> - </p> -</#if> - -a <#-- < --> b -a <#-- </#noParse> - -- --> b - -${1 + 2 + [#-- c --] <#-- c --> <!-- c --> 3} -${<!-- > -> -- #> #] --> 7} -${<#-- glitch... --] 8} -</body> -</html> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.f3ac new file mode 100644 index 0000000..3314765 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.f3ac @@ -0,0 +1,218 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<head> +<title>FreeMarker: Numeric Operations Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>${message}</p> + +<p>Start with the increment operator:</p> +<#assign a1 = 0> +<p>a1 = ${a1}</p> +<#assign a1 = a1 + 1> +<p>a1 = ${a1}</p> +<#assign a1 = a1 + 1> +<p>a1 = ${a1}</p> + +<p>Now the decrement operator:</p> +<#assign a2 = 5> +<p>a2 = ${a2}</p> +<#assign a2 = a2 - 1> +<p>a2 = ${a2}</p> +<#assign a2 = a2 - 1> +<p>a2 = ${a2}</p> +<#assign a2 = a2 - 1> +<p>a2 = ${a2}</p> +<#assign a2 = a2 - 1> +<p>a2 = ${a2}</p> +<#assign a2 = a2 - 1> +<p>a2 = ${a2}</p> +<#assign a2 = a2 - 1> +<p>a2 = ${a2}</p> +<#assign a2 = a2 - 1> + +<p>Now the add operator:</p> +<#assign op1 = 5> +<#assign op2 = 3> +<#assign op3 = op1 + op2> +<p>op1 = ${op1}, op2 = ${op2}, op3 = ${op3}</p> +<#assign op3 = op3 + op2> +<p>op3 = ${op3}</p> + +<p>And the subtract operator:</p> +<#assign op3 = op1 - op2 > +<p>op1 = ${op1}, op2 = ${op2}, op3 = ${op3}</p> +<#assign op3 = op3 - op2 > +<p>op3 = ${op3}</p> + +<p>The comparison operators:</p> +<#assign list1 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]> +<#list list1 as item> + <p>Item is: ${item}</p> + <#if item lt 5> + <p>Item is less than five.</p> + </#if> + <#if item <= 7> + <p>Item is less than or equals to seven.</p> + </#if> + <#if item gt 2> + <p>Item is greater than two.</p> + </#if> + <#if (item >= 10)> + <p>Item is greater than or equal to ten.</p> + </#if> +</#list> + +<#-- Signum-based optimization test, all 9 permutations: --> +<#-- 1 --> +<@assert !(0 != 0) /> +<@assert (0 == 0) /> +<@assert !(0 > 0) /> +<@assert (0 >= 0) /> +<@assert !(0 < 0) /> +<@assert (0 <= 0) /> +<#-- 2 --> +<@assert !(3 != 3) /> +<@assert (3 == 3) /> +<@assert !(3 > 3) /> +<@assert (3 >= 3) /> +<@assert !(3 < 3) /> +<@assert (3 <= 3) /> +<#-- 3 --> +<@assert !(-3 != -3) /> +<@assert (-3 == -3) /> +<@assert !(-3 > -3) /> +<@assert (-3 >= -3) /> +<@assert !(-3 < -3) /> +<@assert (-3 <= -3) /> +<#-- 4 --> +<@assert (3 != 0) /> +<@assert !(3 == 0) /> +<@assert (3 > 0) /> +<@assert (3 >= 0) /> +<@assert !(3 < 0) /> +<@assert !(3 <= 0) /> +<#-- 5 --> +<@assert (0 != 3) /> +<@assert !(0 == 3) /> +<@assert !(0 > 3) /> +<@assert !(0 >= 3) /> +<@assert (0 < 3) /> +<@assert (0 <= 3) /> +<#-- 6 --> +<@assert (-3 != 0) /> +<@assert !(-3 == 0) /> +<@assert !(-3 > 0) /> +<@assert !(-3 >= 0) /> +<@assert (-3 < 0) /> +<@assert (-3 <= 0) /> +<#-- 7 --> +<@assert (0 != -3) /> +<@assert !(0 == -3) /> +<@assert (0 > -3) /> +<@assert (0 >= -3) /> +<@assert !(0 < -3) /> +<@assert !(0 <= -3) /> +<#-- 8 --> +<@assert (-3 != 3) /> +<@assert !(-3 == 3) /> +<@assert !(-3 > 3) /> +<@assert !(-3 >= 3) /> +<@assert (-3 < 3) /> +<@assert (-3 <= 3) /> +<#-- 9 --> +<@assert (3 != -3) /> +<@assert !(3 == -3) /> +<@assert (3 > -3) /> +<@assert (3 >= -3) /> +<@assert !(3 < -3) /> +<@assert !(3 <= -3) /> +<#-- Again, now on runtime: --> +<#assign m3 = -3> +<#assign p3 = 3> +<#assign z = 0> +<#-- 1 --> +<@assert !(z != z) /> +<@assert (z == z) /> +<@assert !(z > z) /> +<@assert (z >= z) /> +<@assert !(z < z) /> +<@assert (z <= z) /> +<#-- 2 --> +<@assert !(p3 != p3) /> +<@assert (p3 == p3) /> +<@assert !(p3 > p3) /> +<@assert (p3 >= p3) /> +<@assert !(p3 < p3) /> +<@assert (p3 <= p3) /> +<#-- 3 --> +<@assert !(m3 != m3) /> +<@assert (m3 == m3) /> +<@assert !(m3 > m3) /> +<@assert (m3 >= m3) /> +<@assert !(m3 < m3) /> +<@assert (m3 <= m3) /> +<#-- 4 --> +<@assert (p3 != z) /> +<@assert !(p3 == z) /> +<@assert (p3 > z) /> +<@assert (p3 >= z) /> +<@assert !(p3 < z) /> +<@assert !(p3 <= z) /> +<#-- 5 --> +<@assert (z != p3) /> +<@assert !(z == p3) /> +<@assert !(z > p3) /> +<@assert !(z >= p3) /> +<@assert (z < p3) /> +<@assert (z <= p3) /> +<#-- 6 --> +<@assert (m3 != z) /> +<@assert !(m3 == z) /> +<@assert !(m3 > z) /> +<@assert !(m3 >= z) /> +<@assert (m3 < z) /> +<@assert (m3 <= z) /> +<#-- 7 --> +<@assert (z != m3) /> +<@assert !(z == m3) /> +<@assert (z > m3) /> +<@assert (z >= m3) /> +<@assert !(z < m3) /> +<@assert !(z <= m3) /> +<#-- 8 --> +<@assert (m3 != p3) /> +<@assert !(m3 == p3) /> +<@assert !(m3 > p3) /> +<@assert !(m3 >= p3) /> +<@assert (m3 < p3) /> +<@assert (m3 <= p3) /> +<#-- 9 --> +<@assert (p3 != m3) /> +<@assert !(p3 == m3) /> +<@assert (p3 > m3) /> +<@assert (p3 >= m3) /> +<@assert !(p3 < m3) /> +<@assert !(p3 <= m3) /> +</body> +</html> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.ftl deleted file mode 100644 index 3314765..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/comparisons.ftl +++ /dev/null @@ -1,218 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<head> -<title>FreeMarker: Numeric Operations Test</title> -</head> -<body> - -<p>A simple test follows:</p> - -<p>${message}</p> - -<p>Start with the increment operator:</p> -<#assign a1 = 0> -<p>a1 = ${a1}</p> -<#assign a1 = a1 + 1> -<p>a1 = ${a1}</p> -<#assign a1 = a1 + 1> -<p>a1 = ${a1}</p> - -<p>Now the decrement operator:</p> -<#assign a2 = 5> -<p>a2 = ${a2}</p> -<#assign a2 = a2 - 1> -<p>a2 = ${a2}</p> -<#assign a2 = a2 - 1> -<p>a2 = ${a2}</p> -<#assign a2 = a2 - 1> -<p>a2 = ${a2}</p> -<#assign a2 = a2 - 1> -<p>a2 = ${a2}</p> -<#assign a2 = a2 - 1> -<p>a2 = ${a2}</p> -<#assign a2 = a2 - 1> -<p>a2 = ${a2}</p> -<#assign a2 = a2 - 1> - -<p>Now the add operator:</p> -<#assign op1 = 5> -<#assign op2 = 3> -<#assign op3 = op1 + op2> -<p>op1 = ${op1}, op2 = ${op2}, op3 = ${op3}</p> -<#assign op3 = op3 + op2> -<p>op3 = ${op3}</p> - -<p>And the subtract operator:</p> -<#assign op3 = op1 - op2 > -<p>op1 = ${op1}, op2 = ${op2}, op3 = ${op3}</p> -<#assign op3 = op3 - op2 > -<p>op3 = ${op3}</p> - -<p>The comparison operators:</p> -<#assign list1 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]> -<#list list1 as item> - <p>Item is: ${item}</p> - <#if item lt 5> - <p>Item is less than five.</p> - </#if> - <#if item <= 7> - <p>Item is less than or equals to seven.</p> - </#if> - <#if item gt 2> - <p>Item is greater than two.</p> - </#if> - <#if (item >= 10)> - <p>Item is greater than or equal to ten.</p> - </#if> -</#list> - -<#-- Signum-based optimization test, all 9 permutations: --> -<#-- 1 --> -<@assert !(0 != 0) /> -<@assert (0 == 0) /> -<@assert !(0 > 0) /> -<@assert (0 >= 0) /> -<@assert !(0 < 0) /> -<@assert (0 <= 0) /> -<#-- 2 --> -<@assert !(3 != 3) /> -<@assert (3 == 3) /> -<@assert !(3 > 3) /> -<@assert (3 >= 3) /> -<@assert !(3 < 3) /> -<@assert (3 <= 3) /> -<#-- 3 --> -<@assert !(-3 != -3) /> -<@assert (-3 == -3) /> -<@assert !(-3 > -3) /> -<@assert (-3 >= -3) /> -<@assert !(-3 < -3) /> -<@assert (-3 <= -3) /> -<#-- 4 --> -<@assert (3 != 0) /> -<@assert !(3 == 0) /> -<@assert (3 > 0) /> -<@assert (3 >= 0) /> -<@assert !(3 < 0) /> -<@assert !(3 <= 0) /> -<#-- 5 --> -<@assert (0 != 3) /> -<@assert !(0 == 3) /> -<@assert !(0 > 3) /> -<@assert !(0 >= 3) /> -<@assert (0 < 3) /> -<@assert (0 <= 3) /> -<#-- 6 --> -<@assert (-3 != 0) /> -<@assert !(-3 == 0) /> -<@assert !(-3 > 0) /> -<@assert !(-3 >= 0) /> -<@assert (-3 < 0) /> -<@assert (-3 <= 0) /> -<#-- 7 --> -<@assert (0 != -3) /> -<@assert !(0 == -3) /> -<@assert (0 > -3) /> -<@assert (0 >= -3) /> -<@assert !(0 < -3) /> -<@assert !(0 <= -3) /> -<#-- 8 --> -<@assert (-3 != 3) /> -<@assert !(-3 == 3) /> -<@assert !(-3 > 3) /> -<@assert !(-3 >= 3) /> -<@assert (-3 < 3) /> -<@assert (-3 <= 3) /> -<#-- 9 --> -<@assert (3 != -3) /> -<@assert !(3 == -3) /> -<@assert (3 > -3) /> -<@assert (3 >= -3) /> -<@assert !(3 < -3) /> -<@assert !(3 <= -3) /> -<#-- Again, now on runtime: --> -<#assign m3 = -3> -<#assign p3 = 3> -<#assign z = 0> -<#-- 1 --> -<@assert !(z != z) /> -<@assert (z == z) /> -<@assert !(z > z) /> -<@assert (z >= z) /> -<@assert !(z < z) /> -<@assert (z <= z) /> -<#-- 2 --> -<@assert !(p3 != p3) /> -<@assert (p3 == p3) /> -<@assert !(p3 > p3) /> -<@assert (p3 >= p3) /> -<@assert !(p3 < p3) /> -<@assert (p3 <= p3) /> -<#-- 3 --> -<@assert !(m3 != m3) /> -<@assert (m3 == m3) /> -<@assert !(m3 > m3) /> -<@assert (m3 >= m3) /> -<@assert !(m3 < m3) /> -<@assert (m3 <= m3) /> -<#-- 4 --> -<@assert (p3 != z) /> -<@assert !(p3 == z) /> -<@assert (p3 > z) /> -<@assert (p3 >= z) /> -<@assert !(p3 < z) /> -<@assert !(p3 <= z) /> -<#-- 5 --> -<@assert (z != p3) /> -<@assert !(z == p3) /> -<@assert !(z > p3) /> -<@assert !(z >= p3) /> -<@assert (z < p3) /> -<@assert (z <= p3) /> -<#-- 6 --> -<@assert (m3 != z) /> -<@assert !(m3 == z) /> -<@assert !(m3 > z) /> -<@assert !(m3 >= z) /> -<@assert (m3 < z) /> -<@assert (m3 <= z) /> -<#-- 7 --> -<@assert (z != m3) /> -<@assert !(z == m3) /> -<@assert (z > m3) /> -<@assert (z >= m3) /> -<@assert !(z < m3) /> -<@assert !(z <= m3) /> -<#-- 8 --> -<@assert (m3 != p3) /> -<@assert !(m3 == p3) /> -<@assert !(m3 > p3) /> -<@assert !(m3 >= p3) /> -<@assert (m3 < p3) /> -<@assert (m3 <= p3) /> -<#-- 9 --> -<@assert (p3 != m3) /> -<@assert !(p3 == m3) /> -<@assert (p3 > m3) /> -<@assert (p3 >= m3) /> -<@assert !(p3 < m3) /> -<@assert !(p3 <= m3) /> -</body> -</html> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.f3ac new file mode 100644 index 0000000..2edd306 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.f3ac @@ -0,0 +1,42 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<head> +<title>FreeMarker: Compress Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>${message}</p> + +<#compress> + + <p>This is the same message, using the "compress" tag:</p> + + +<p>${message}</p> +</#compress> + +<p>An example where the first character is not whitespace but the second character is:</p> +<p><#compress>x y</#compress></p> + +<p>The end.</p> +</body> +</html> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.ftl deleted file mode 100644 index 2edd306..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/compress.ftl +++ /dev/null @@ -1,42 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<html> -<head> -<title>FreeMarker: Compress Test</title> -</head> -<body> - -<p>A simple test follows:</p> - -<p>${message}</p> - -<#compress> - - <p>This is the same message, using the "compress" tag:</p> - - -<p>${message}</p> -</#compress> - -<p>An example where the first character is not whitespace but the second character is:</p> -<p><#compress>x y</#compress></p> - -<p>The end.</p> -</body> -</html> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.f3ac new file mode 100644 index 0000000..9e3025d --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.f3ac @@ -0,0 +1,47 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<#setting timeZone = "UTC"> + +<@assert unknown?isUnknownDateLike /> +<@assert !timeOnly?isUnknownDateLike /> +<@assert !dateOnly?isUnknownDateLike /> +<@assert !dateTime?isUnknownDateLike /> + +<@assert !unknown?isDateOnly /> +<@assert !timeOnly?isDateOnly /> +<@assert dateOnly?isDateOnly /> +<@assert !dateTime?isDateOnly /> + +<@assert !unknown?isTime /> +<@assert timeOnly?isTime /> +<@assert !dateOnly?isTime /> +<@assert !dateTime?isTime /> + +<@assert !unknown?isDatetime /> +<@assert !timeOnly?isDatetime /> +<@assert !dateOnly?isDatetime /> +<@assert dateTime?isDatetime /> + +<@assertFails message="isn't known if">${unknown?string.xs}</@> +<@assertEquals expected="2003-04-05T06:07:08Z" actual=unknown?dateTimeIfUnknown?string.xs /> +<@assertEquals expected="2003-04-05Z" actual=unknown?dateIfUnknown?string.xs /> +<@assertEquals expected="06:07:08Z" actual=unknown?timeIfUnknown?string.xs /> +<@assertEquals expected="2003-04-05T06:07:08Z" actual=dateTime?dateIfUnknown?string.xs /> +<@assertEquals expected="2003-04-05" actual=dateOnly?timeIfUnknown?string.xs /> +<@assertEquals expected="06:07:08" actual=timeOnly?dateIfUnknown?string.xs /> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.ftl deleted file mode 100644 index 9e3025d..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/date-type-builtins.ftl +++ /dev/null @@ -1,47 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<#setting timeZone = "UTC"> - -<@assert unknown?isUnknownDateLike /> -<@assert !timeOnly?isUnknownDateLike /> -<@assert !dateOnly?isUnknownDateLike /> -<@assert !dateTime?isUnknownDateLike /> - -<@assert !unknown?isDateOnly /> -<@assert !timeOnly?isDateOnly /> -<@assert dateOnly?isDateOnly /> -<@assert !dateTime?isDateOnly /> - -<@assert !unknown?isTime /> -<@assert timeOnly?isTime /> -<@assert !dateOnly?isTime /> -<@assert !dateTime?isTime /> - -<@assert !unknown?isDatetime /> -<@assert !timeOnly?isDatetime /> -<@assert !dateOnly?isDatetime /> -<@assert dateTime?isDatetime /> - -<@assertFails message="isn't known if">${unknown?string.xs}</@> -<@assertEquals expected="2003-04-05T06:07:08Z" actual=unknown?dateTimeIfUnknown?string.xs /> -<@assertEquals expected="2003-04-05Z" actual=unknown?dateIfUnknown?string.xs /> -<@assertEquals expected="06:07:08Z" actual=unknown?timeIfUnknown?string.xs /> -<@assertEquals expected="2003-04-05T06:07:08Z" actual=dateTime?dateIfUnknown?string.xs /> -<@assertEquals expected="2003-04-05" actual=dateOnly?timeIfUnknown?string.xs /> -<@assertEquals expected="06:07:08" actual=timeOnly?dateIfUnknown?string.xs /> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.f3ac new file mode 100644 index 0000000..f2dc1cb --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.f3ac @@ -0,0 +1,163 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<#assign d = "2010-05-15 22:38:05:23 +0200"?dateTime("yyyy-MM-dd HH:mm:ss:S Z")> +<#setting timeZone="GMT+02"> +<@assertEquals actual=d?isoUtc expected="2010-05-15T20:38:05Z" /> +<@assertEquals actual=d?isoUtcMs expected="2010-05-15T20:38:05.023Z" /> +<@assertEquals actual=d?isoUtcM expected="2010-05-15T20:38Z" /> +<@assertEquals actual=d?isoUtcH expected="2010-05-15T20Z" /> +<@assertEquals actual=d?isoUtcNZ expected="2010-05-15T20:38:05" /> +<@assertEquals actual=d?isoUtcMsNZ expected="2010-05-15T20:38:05.023" /> +<@assertEquals actual=d?isoUtcMNZ expected="2010-05-15T20:38" /> +<@assertEquals actual=d?isoUtcHNZ expected="2010-05-15T20" /> +<@assertEquals actual=d?isoLocal expected="2010-05-15T22:38:05+02:00" /> +<@assertEquals actual=d?isoLocalMs expected="2010-05-15T22:38:05.023+02:00" /> +<@assertEquals actual=d?isoLocalM expected="2010-05-15T22:38+02:00" /> +<@assertEquals actual=d?isoLocalH expected="2010-05-15T22+02:00" /> +<@assertEquals actual=d?isoLocalNZ expected="2010-05-15T22:38:05" /> +<@assertEquals actual=d?isoLocalMsNZ expected="2010-05-15T22:38:05.023" /> +<@assertEquals actual=d?isoLocalMNZ expected="2010-05-15T22:38" /> +<@assertEquals actual=d?isoLocalHNZ expected="2010-05-15T22" /> + +<@assertEquals actual=d?date?isoUtc expected="2010-05-15" /> +<@assertEquals actual=d?date?isoUtcMs expected="2010-05-15" /> +<@assertEquals actual=d?date?isoUtcM expected="2010-05-15" /> +<@assertEquals actual=d?date?isoUtcH expected="2010-05-15" /> +<@assertEquals actual=d?date?isoUtcNZ expected="2010-05-15" /> +<@assertEquals actual=d?date?isoUtcMsNZ expected="2010-05-15" /> +<@assertEquals actual=d?date?isoUtcMNZ expected="2010-05-15" /> +<@assertEquals actual=d?date?isoUtcHNZ expected="2010-05-15" /> +<@assertEquals actual=d?date?isoLocal expected="2010-05-15" /> +<@assertEquals actual=d?date?isoLocalMs expected="2010-05-15" /> +<@assertEquals actual=d?date?isoLocalM expected="2010-05-15" /> +<@assertEquals actual=d?date?isoLocalH expected="2010-05-15" /> +<@assertEquals actual=d?date?isoLocalNZ expected="2010-05-15" /> +<@assertEquals actual=d?date?isoLocalMsNZ expected="2010-05-15" /> +<@assertEquals actual=d?date?isoLocalMNZ expected="2010-05-15" /> +<@assertEquals actual=d?date?isoLocalHNZ expected="2010-05-15" /> + +<@assertEquals actual=d?time?isoUtc expected="20:38:05Z" /> +<@assertEquals actual=d?time?isoUtcMs expected="20:38:05.023Z" /> +<@assertEquals actual=d?time?isoUtcM expected="20:38Z" /> +<@assertEquals actual=d?time?isoUtcH expected="20Z" /> +<@assertEquals actual=d?time?isoUtcNZ expected="20:38:05" /> +<@assertEquals actual=d?time?isoUtcMsNZ expected="20:38:05.023" /> +<@assertEquals actual=d?time?isoUtcMNZ expected="20:38" /> +<@assertEquals actual=d?time?isoUtcHNZ expected="20" /> +<@assertEquals actual=d?time?isoLocal expected="22:38:05+02:00" /> +<@assertEquals actual=d?time?isoLocalMs expected="22:38:05.023+02:00" /> +<@assertEquals actual=d?time?isoLocalM expected="22:38+02:00" /> +<@assertEquals actual=d?time?isoLocalH expected="22+02:00" /> +<@assertEquals actual=d?time?isoLocalNZ expected="22:38:05" /> +<@assertEquals actual=d?time?isoLocalMsNZ expected="22:38:05.023" /> +<@assertEquals actual=d?time?isoLocalMNZ expected="22:38" /> +<@assertEquals actual=d?time?isoLocalHNZ expected="22" /> + +<#assign dStrange = "600-01-01 23:59:59:123 +0000"?dateTime("yyyy-MM-dd HH:mm:ss:S Z")> +<@assertEquals actual=dStrange?isoUtcMs expected="0600-01-03T23:59:59.123Z" /> + +<#-- java.sql treatment --> +<@assertEquals actual=sqlDate?isoLocal expected="2010-05-15" /> +<@assertEquals actual=sqlDate?isoLocalNZ expected="2010-05-15" /> +<@assertEquals actual=sqlTime?isoLocalNZ expected="22:38:05" /> +<@assertEquals actual=sqlTime?isoUtcNZ expected="20:38:05" /> + +<#setting timeZone="GMT+03"> <#-- should not mater --> +<@assertEquals actual=d?iso("UTC") expected="2010-05-15T20:38:05Z" /> +<@assertEquals actual=d?isoMs("UTC") expected="2010-05-15T20:38:05.023Z" /> +<@assertEquals actual=d?isoM("UTC") expected="2010-05-15T20:38Z" /> +<@assertEquals actual=d?isoH("UTC") expected="2010-05-15T20Z" /> +<@assertEquals actual=d?isoNZ("UTC") expected="2010-05-15T20:38:05" /> +<@assertEquals actual=d?isoMsNZ("UTC") expected="2010-05-15T20:38:05.023" /> +<@assertEquals actual=d?isoMNZ("UTC") expected="2010-05-15T20:38" /> +<@assertEquals actual=d?isoHNZ("UTC") expected="2010-05-15T20" /> +<@assertEquals actual=d?iso("GMT+02") expected="2010-05-15T22:38:05+02:00" /> +<@assertEquals actual=d?isoMs("GMT+02") expected="2010-05-15T22:38:05.023+02:00" /> +<@assertEquals actual=d?isoM("GMT+02") expected="2010-05-15T22:38+02:00" /> +<@assertEquals actual=d?isoH("GMT+02") expected="2010-05-15T22+02:00" /> +<@assertEquals actual=d?isoNZ("GMT+02") expected="2010-05-15T22:38:05" /> +<@assertEquals actual=d?isoMsNZ("GMT+02") expected="2010-05-15T22:38:05.023" /> +<@assertEquals actual=d?isoMNZ("GMT+02") expected="2010-05-15T22:38" /> +<@assertEquals actual=d?isoHNZ("GMT+02") expected="2010-05-15T22" /> + +<@assertEquals actual=d?date?iso("UTC") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoMs("UTC") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoM("UTC") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoH("UTC") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoNZ("UTC") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoMsNZ("UTC") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoMNZ("UTC") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoHNZ("UTC") expected="2010-05-15" /> +<@assertEquals actual=d?date?iso("GMT+02") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoMs("GMT+02") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoM("GMT+02") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoH("GMT+02") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoNZ("GMT+02") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoMsNZ("GMT+02") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoMNZ("GMT+02") expected="2010-05-15" /> +<@assertEquals actual=d?date?isoHNZ("GMT+02") expected="2010-05-15" /> + +<@assertEquals actual=d?time?iso("UTC") expected="20:38:05Z" /> +<@assertEquals actual=d?time?isoMs("UTC") expected="20:38:05.023Z" /> +<@assertEquals actual=d?time?isoM("UTC") expected="20:38Z" /> +<@assertEquals actual=d?time?isoH("UTC") expected="20Z" /> +<@assertEquals actual=d?time?isoNZ("UTC") expected="20:38:05" /> +<@assertEquals actual=d?time?isoMsNZ("UTC") expected="20:38:05.023" /> +<@assertEquals actual=d?time?isoMNZ("UTC") expected="20:38" /> +<@assertEquals actual=d?time?isoHNZ("UTC") expected="20" /> +<@assertEquals actual=d?time?iso("GMT+02") expected="22:38:05+02:00" /> +<@assertEquals actual=d?time?isoMs("GMT+02") expected="22:38:05.023+02:00" /> +<@assertEquals actual=d?time?isoM("GMT+02") expected="22:38+02:00" /> +<@assertEquals actual=d?time?isoH("GMT+02") expected="22+02:00" /> +<@assertEquals actual=d?time?isoNZ("GMT+02") expected="22:38:05" /> +<@assertEquals actual=d?time?isoMsNZ("GMT+02") expected="22:38:05.023" /> +<@assertEquals actual=d?time?isoMNZ("GMT+02") expected="22:38" /> +<@assertEquals actual=d?time?isoHNZ("GMT+02") expected="22" /> + +<@assertEquals actual=d?iso(javaUTC) expected="2010-05-15T20:38:05Z" /> +<@assertEquals actual=d?iso(javaGMT02) expected="2010-05-15T22:38:05+02:00" /> +<@assertEquals actual=d?iso(adaptedToString) expected="2010-05-15T22:38:05+02:00" /> + +<#assign d = "12:00:00:1 +0000"?time("HH:mm:ss:S Z")> +<@assertEquals actual=d?isoUtcMs expected="12:00:00.001Z" /> +<#assign d = "12:00:00:10 +0000"?time("HH:mm:ss:S Z")> +<@assertEquals actual=d?isoUtcMs expected="12:00:00.01Z" /> +<#assign d = "12:00:00:100 +0000"?time("HH:mm:ss:S Z")> +<@assertEquals actual=d?isoUtcMs expected="12:00:00.1Z" /> +<#assign d = "12:00:00:0 +0000"?time("HH:mm:ss:S Z")> +<@assertEquals actual=d?isoUtcMs expected="12:00:00Z" /> + +<#setting timeZone="GMT+02"> +<#assign d = "2010-05-15"?date("yyyy-MM-dd")> +<@assertEquals actual=d?isoLocal expected="2010-05-15" /> +<@assertEquals actual=d?isoUtc expected="2010-05-14" /> + +<#setting timeZone="GMT+02:30"> +<#assign d = "2010-05-15"?dateTime("yyyy-MM-dd")> +<@assertEquals actual=d?isoLocal expected="2010-05-15T00:00:00+02:30" /> + +<#setting timeZone="America/New_York"> +<@assertEquals actual="2010-05-09 20:00 +0000"?dateTime("yyyy-MM-dd HH:mm Z")?isoLocal expected="2010-05-09T16:00:00-04:00" /> +<@assertEquals actual="2010-01-01 20:00 +0000"?dateTime("yyyy-MM-dd HH:mm Z")?isoLocal expected="2010-01-01T15:00:00-05:00" /> + +<@assertFails>${d?iso("no such zone")}</@> + +<#setting timeZone="GMT+02"> +<@assertEquals actual=sqlTime?isoLocal expected="22:38:05" /> +<@assertEquals actual=sqlTime?isoUtc expected="20:38:05" /> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.ftl deleted file mode 100644 index f2dc1cb..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-bi.ftl +++ /dev/null @@ -1,163 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<#assign d = "2010-05-15 22:38:05:23 +0200"?dateTime("yyyy-MM-dd HH:mm:ss:S Z")> -<#setting timeZone="GMT+02"> -<@assertEquals actual=d?isoUtc expected="2010-05-15T20:38:05Z" /> -<@assertEquals actual=d?isoUtcMs expected="2010-05-15T20:38:05.023Z" /> -<@assertEquals actual=d?isoUtcM expected="2010-05-15T20:38Z" /> -<@assertEquals actual=d?isoUtcH expected="2010-05-15T20Z" /> -<@assertEquals actual=d?isoUtcNZ expected="2010-05-15T20:38:05" /> -<@assertEquals actual=d?isoUtcMsNZ expected="2010-05-15T20:38:05.023" /> -<@assertEquals actual=d?isoUtcMNZ expected="2010-05-15T20:38" /> -<@assertEquals actual=d?isoUtcHNZ expected="2010-05-15T20" /> -<@assertEquals actual=d?isoLocal expected="2010-05-15T22:38:05+02:00" /> -<@assertEquals actual=d?isoLocalMs expected="2010-05-15T22:38:05.023+02:00" /> -<@assertEquals actual=d?isoLocalM expected="2010-05-15T22:38+02:00" /> -<@assertEquals actual=d?isoLocalH expected="2010-05-15T22+02:00" /> -<@assertEquals actual=d?isoLocalNZ expected="2010-05-15T22:38:05" /> -<@assertEquals actual=d?isoLocalMsNZ expected="2010-05-15T22:38:05.023" /> -<@assertEquals actual=d?isoLocalMNZ expected="2010-05-15T22:38" /> -<@assertEquals actual=d?isoLocalHNZ expected="2010-05-15T22" /> - -<@assertEquals actual=d?date?isoUtc expected="2010-05-15" /> -<@assertEquals actual=d?date?isoUtcMs expected="2010-05-15" /> -<@assertEquals actual=d?date?isoUtcM expected="2010-05-15" /> -<@assertEquals actual=d?date?isoUtcH expected="2010-05-15" /> -<@assertEquals actual=d?date?isoUtcNZ expected="2010-05-15" /> -<@assertEquals actual=d?date?isoUtcMsNZ expected="2010-05-15" /> -<@assertEquals actual=d?date?isoUtcMNZ expected="2010-05-15" /> -<@assertEquals actual=d?date?isoUtcHNZ expected="2010-05-15" /> -<@assertEquals actual=d?date?isoLocal expected="2010-05-15" /> -<@assertEquals actual=d?date?isoLocalMs expected="2010-05-15" /> -<@assertEquals actual=d?date?isoLocalM expected="2010-05-15" /> -<@assertEquals actual=d?date?isoLocalH expected="2010-05-15" /> -<@assertEquals actual=d?date?isoLocalNZ expected="2010-05-15" /> -<@assertEquals actual=d?date?isoLocalMsNZ expected="2010-05-15" /> -<@assertEquals actual=d?date?isoLocalMNZ expected="2010-05-15" /> -<@assertEquals actual=d?date?isoLocalHNZ expected="2010-05-15" /> - -<@assertEquals actual=d?time?isoUtc expected="20:38:05Z" /> -<@assertEquals actual=d?time?isoUtcMs expected="20:38:05.023Z" /> -<@assertEquals actual=d?time?isoUtcM expected="20:38Z" /> -<@assertEquals actual=d?time?isoUtcH expected="20Z" /> -<@assertEquals actual=d?time?isoUtcNZ expected="20:38:05" /> -<@assertEquals actual=d?time?isoUtcMsNZ expected="20:38:05.023" /> -<@assertEquals actual=d?time?isoUtcMNZ expected="20:38" /> -<@assertEquals actual=d?time?isoUtcHNZ expected="20" /> -<@assertEquals actual=d?time?isoLocal expected="22:38:05+02:00" /> -<@assertEquals actual=d?time?isoLocalMs expected="22:38:05.023+02:00" /> -<@assertEquals actual=d?time?isoLocalM expected="22:38+02:00" /> -<@assertEquals actual=d?time?isoLocalH expected="22+02:00" /> -<@assertEquals actual=d?time?isoLocalNZ expected="22:38:05" /> -<@assertEquals actual=d?time?isoLocalMsNZ expected="22:38:05.023" /> -<@assertEquals actual=d?time?isoLocalMNZ expected="22:38" /> -<@assertEquals actual=d?time?isoLocalHNZ expected="22" /> - -<#assign dStrange = "600-01-01 23:59:59:123 +0000"?dateTime("yyyy-MM-dd HH:mm:ss:S Z")> -<@assertEquals actual=dStrange?isoUtcMs expected="0600-01-03T23:59:59.123Z" /> - -<#-- java.sql treatment --> -<@assertEquals actual=sqlDate?isoLocal expected="2010-05-15" /> -<@assertEquals actual=sqlDate?isoLocalNZ expected="2010-05-15" /> -<@assertEquals actual=sqlTime?isoLocalNZ expected="22:38:05" /> -<@assertEquals actual=sqlTime?isoUtcNZ expected="20:38:05" /> - -<#setting timeZone="GMT+03"> <#-- should not mater --> -<@assertEquals actual=d?iso("UTC") expected="2010-05-15T20:38:05Z" /> -<@assertEquals actual=d?isoMs("UTC") expected="2010-05-15T20:38:05.023Z" /> -<@assertEquals actual=d?isoM("UTC") expected="2010-05-15T20:38Z" /> -<@assertEquals actual=d?isoH("UTC") expected="2010-05-15T20Z" /> -<@assertEquals actual=d?isoNZ("UTC") expected="2010-05-15T20:38:05" /> -<@assertEquals actual=d?isoMsNZ("UTC") expected="2010-05-15T20:38:05.023" /> -<@assertEquals actual=d?isoMNZ("UTC") expected="2010-05-15T20:38" /> -<@assertEquals actual=d?isoHNZ("UTC") expected="2010-05-15T20" /> -<@assertEquals actual=d?iso("GMT+02") expected="2010-05-15T22:38:05+02:00" /> -<@assertEquals actual=d?isoMs("GMT+02") expected="2010-05-15T22:38:05.023+02:00" /> -<@assertEquals actual=d?isoM("GMT+02") expected="2010-05-15T22:38+02:00" /> -<@assertEquals actual=d?isoH("GMT+02") expected="2010-05-15T22+02:00" /> -<@assertEquals actual=d?isoNZ("GMT+02") expected="2010-05-15T22:38:05" /> -<@assertEquals actual=d?isoMsNZ("GMT+02") expected="2010-05-15T22:38:05.023" /> -<@assertEquals actual=d?isoMNZ("GMT+02") expected="2010-05-15T22:38" /> -<@assertEquals actual=d?isoHNZ("GMT+02") expected="2010-05-15T22" /> - -<@assertEquals actual=d?date?iso("UTC") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoMs("UTC") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoM("UTC") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoH("UTC") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoNZ("UTC") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoMsNZ("UTC") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoMNZ("UTC") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoHNZ("UTC") expected="2010-05-15" /> -<@assertEquals actual=d?date?iso("GMT+02") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoMs("GMT+02") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoM("GMT+02") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoH("GMT+02") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoNZ("GMT+02") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoMsNZ("GMT+02") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoMNZ("GMT+02") expected="2010-05-15" /> -<@assertEquals actual=d?date?isoHNZ("GMT+02") expected="2010-05-15" /> - -<@assertEquals actual=d?time?iso("UTC") expected="20:38:05Z" /> -<@assertEquals actual=d?time?isoMs("UTC") expected="20:38:05.023Z" /> -<@assertEquals actual=d?time?isoM("UTC") expected="20:38Z" /> -<@assertEquals actual=d?time?isoH("UTC") expected="20Z" /> -<@assertEquals actual=d?time?isoNZ("UTC") expected="20:38:05" /> -<@assertEquals actual=d?time?isoMsNZ("UTC") expected="20:38:05.023" /> -<@assertEquals actual=d?time?isoMNZ("UTC") expected="20:38" /> -<@assertEquals actual=d?time?isoHNZ("UTC") expected="20" /> -<@assertEquals actual=d?time?iso("GMT+02") expected="22:38:05+02:00" /> -<@assertEquals actual=d?time?isoMs("GMT+02") expected="22:38:05.023+02:00" /> -<@assertEquals actual=d?time?isoM("GMT+02") expected="22:38+02:00" /> -<@assertEquals actual=d?time?isoH("GMT+02") expected="22+02:00" /> -<@assertEquals actual=d?time?isoNZ("GMT+02") expected="22:38:05" /> -<@assertEquals actual=d?time?isoMsNZ("GMT+02") expected="22:38:05.023" /> -<@assertEquals actual=d?time?isoMNZ("GMT+02") expected="22:38" /> -<@assertEquals actual=d?time?isoHNZ("GMT+02") expected="22" /> - -<@assertEquals actual=d?iso(javaUTC) expected="2010-05-15T20:38:05Z" /> -<@assertEquals actual=d?iso(javaGMT02) expected="2010-05-15T22:38:05+02:00" /> -<@assertEquals actual=d?iso(adaptedToString) expected="2010-05-15T22:38:05+02:00" /> - -<#assign d = "12:00:00:1 +0000"?time("HH:mm:ss:S Z")> -<@assertEquals actual=d?isoUtcMs expected="12:00:00.001Z" /> -<#assign d = "12:00:00:10 +0000"?time("HH:mm:ss:S Z")> -<@assertEquals actual=d?isoUtcMs expected="12:00:00.01Z" /> -<#assign d = "12:00:00:100 +0000"?time("HH:mm:ss:S Z")> -<@assertEquals actual=d?isoUtcMs expected="12:00:00.1Z" /> -<#assign d = "12:00:00:0 +0000"?time("HH:mm:ss:S Z")> -<@assertEquals actual=d?isoUtcMs expected="12:00:00Z" /> - -<#setting timeZone="GMT+02"> -<#assign d = "2010-05-15"?date("yyyy-MM-dd")> -<@assertEquals actual=d?isoLocal expected="2010-05-15" /> -<@assertEquals actual=d?isoUtc expected="2010-05-14" /> - -<#setting timeZone="GMT+02:30"> -<#assign d = "2010-05-15"?dateTime("yyyy-MM-dd")> -<@assertEquals actual=d?isoLocal expected="2010-05-15T00:00:00+02:30" /> - -<#setting timeZone="America/New_York"> -<@assertEquals actual="2010-05-09 20:00 +0000"?dateTime("yyyy-MM-dd HH:mm Z")?isoLocal expected="2010-05-09T16:00:00-04:00" /> -<@assertEquals actual="2010-01-01 20:00 +0000"?dateTime("yyyy-MM-dd HH:mm Z")?isoLocal expected="2010-01-01T15:00:00-05:00" /> - -<@assertFails>${d?iso("no such zone")}</@> - -<#setting timeZone="GMT+02"> -<@assertEquals actual=sqlTime?isoLocal expected="22:38:05" /> -<@assertEquals actual=sqlTime?isoUtc expected="20:38:05" /> http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.f3ac new file mode 100644 index 0000000..5691f82 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.f3ac @@ -0,0 +1,155 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<#assign d = "2010-05-15 22:38:05:23 +0200"?dateTime("yyyy-MM-dd HH:mm:ss:S Z")> +<#setting timeZone="GMT+02"> +<@assertEquals actual=d?string.xs expected="2010-05-15T22:38:05.023+02:00" /> +<@assertEquals actual=d?string.iso expected="2010-05-15T22:38:05.023+02:00" /> +<@assertEquals actual=d?string('xs') expected="2010-05-15T22:38:05.023+02:00" /> +<@assertEquals actual=d?string('iso') expected="2010-05-15T22:38:05.023+02:00" /> +<@assertEquals actual=d?string.xs_nz expected="2010-05-15T22:38:05.023" /> +<@assertEquals actual=d?string.iso_nz expected="2010-05-15T22:38:05.023" /> +<@assertEquals actual=d?string.xs_fz expected="2010-05-15T22:38:05.023+02:00" /> +<@assertEquals actual=d?string.iso_fz expected="2010-05-15T22:38:05.023+02:00" /> +<@assertEquals actual=d?string.xs_u expected="2010-05-15T20:38:05.023Z" /> +<@assertEquals actual=d?string.iso_u expected="2010-05-15T20:38:05.023Z" /> +<@assertEquals actual=d?string.xs_s_u expected="2010-05-15T20:38:05Z" /> +<@assertEquals actual=d?string.iso_s_u expected="2010-05-15T20:38:05Z" /> + +<@assertEquals actual=d?date?string.xs expected="2010-05-15+02:00" /> +<@assertEquals actual=d?date?string.iso expected="2010-05-15" /> +<@assertEquals actual=d?date?string.xs_nz expected="2010-05-15" /> +<@assertEquals actual=d?date?string.iso_nz expected="2010-05-15" /> +<@assertEquals actual=d?date?string.xs_fz expected="2010-05-15+02:00" /> +<@assertEquals actual=d?date?string.iso_fz expected="2010-05-15" /> + +<@assertEquals actual=d?time?string.xs expected="22:38:05.023+02:00" /> +<@assertEquals actual=d?time?string.iso expected="22:38:05.023+02:00" /> +<@assertEquals actual=d?time?string.xs_nz expected="22:38:05.023" /> +<@assertEquals actual=d?time?string.iso_nz expected="22:38:05.023" /> +<@assertEquals actual=d?time?string.xs_fz expected="22:38:05.023+02:00" /> +<@assertEquals actual=d?time?string.iso_fz expected="22:38:05.023+02:00" /> + +<#-- java.sql treatment --> +<@assertEquals actual=sqlDate?string.xs expected="2010-05-15" /> +<@assertEquals actual=sqlDate?string.iso expected="2010-05-15" /> +<@assertEquals actual=sqlDate?string.xs_fz expected="2010-05-15+02:00" /> +<@assertEquals actual=sqlDate?string.iso_fz expected="2010-05-15" /> +<@assertEquals actual=sqlDate?string.xs_nz expected="2010-05-15" /> +<@assertEquals actual=sqlDate?string.iso_nz expected="2010-05-15" /> +<@assertEquals actual=sqlTime?string.xs expected="22:38:05.023" /> +<@assertEquals actual=sqlTime?string.iso expected="22:38:05.023" /> +<@assertEquals actual=sqlTime?string.xs_fz expected="22:38:05.023+02:00" /> +<@assertEquals actual=sqlTime?string.iso_fz expected="22:38:05.023+02:00" /> +<@assertEquals actual=sqlTime?string.xs_nz expected="22:38:05.023" /> +<@assertEquals actual=sqlTime?string.iso_nz expected="22:38:05.023" /> + +<#assign d = "12:30:15:1 +0200"?time("HH:mm:ss:S Z")> +<@assertEquals actual=d?string.xs expected="12:30:15.001+02:00" /> +<@assertEquals actual=d?string.iso expected="12:30:15.001+02:00" /> +<@assertEquals actual=d?string.xs_ms expected="12:30:15.001+02:00" /> +<@assertEquals actual=d?string.iso_ms expected="12:30:15.001+02:00" /> +<@assertEquals actual=d?string.iso_s expected="12:30:15+02:00" /> +<@assertEquals actual=d?string.iso_m expected="12:30+02:00" /> +<@assertEquals actual=d?string.iso_h expected="12+02:00" /> +<#assign d = "12:30:15:10 +0200"?time("HH:mm:ss:S Z")> +<@assertEquals actual=d?string.xs expected="12:30:15.01+02:00" /> +<@assertEquals actual=d?string.iso expected="12:30:15.01+02:00" /> +<@assertEquals actual=d?string.xs_ms expected="12:30:15.010+02:00" /> +<@assertEquals actual=d?string.iso_ms expected="12:30:15.010+02:00" /> +<#assign d = "12:30:15:100 +0200"?time("HH:mm:ss:S Z")> +<@assertEquals actual=d?string.xs expected="12:30:15.1+02:00" /> +<@assertEquals actual=d?string.iso expected="12:30:15.1+02:00" /> +<@assertEquals actual=d?string.xs_ms expected="12:30:15.100+02:00" /> +<@assertEquals actual=d?string.iso_ms expected="12:30:15.100+02:00" /> +<#assign d = "12:30:15:0 +0200"?time("HH:mm:ss:S Z")> +<@assertEquals actual=d?string.xs expected="12:30:15+02:00" /> +<@assertEquals actual=d?string.iso expected="12:30:15+02:00" /> +<@assertEquals actual=d?string.xs_ms expected="12:30:15.000+02:00" /> +<@assertEquals actual=d?string.iso_ms expected="12:30:15.000+02:00" /> + +<#setting timeZone="GMT+02"> +<#assign d = "2010-05-15"?date("yyyy-MM-dd")> +<@assertEquals actual=d?string.xs expected="2010-05-15+02:00" /> +<@assertEquals actual=d?string.iso expected="2010-05-15" /> +<#setting timeZone="GMT+00"> +<@assertEquals actual=d?string.xs expected="2010-05-14Z" /> +<@assertEquals actual=d?string.iso expected="2010-05-14" /> + +<#setting timeZone="GMT+02:30"> +<#assign d = "2010-05-15"?dateTime("yyyy-MM-dd")> +<@assertEquals actual=d?string.xs expected="2010-05-15T00:00:00+02:30" /> +<@assertEquals actual=d?string.iso expected="2010-05-15T00:00:00+02:30" /> + +<#setting timeZone="GMT-05"> +<#setting locale = "en_US"> +<#assign d = "BC 0001-05-15"?date("G yyyy-MM-dd")> +<#-- Tests that: (a) BC 1 isn't 0 like in ISO 8601; (b) No Julian calendar is used. --> +<@assertEquals actual=d?string.xs expected="-1-05-13-05:00" /> +<@assertEquals actual=d?string.iso expected="0000-05-13" /> + +<#assign dt = "2010-05-15T01:02:03"?dateTime.xs> +<#setting dateTimeFormat="xs"> +<@assertEquals actual=dt?string expected="2010-05-15T01:02:03-05:00" /> +<#setting dateTimeFormat="xs u"> +<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" /> +<#setting dateTimeFormat="iso u"> +<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" /> +<#setting dateTimeFormat="xs fz"> +<@assertEquals actual=dt?string expected="2010-05-15T01:02:03-05:00" /> +<#setting dateTimeFormat="xs fz u"> +<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" /> +<#setting dateTimeFormat="xs nz u"> +<@assertEquals actual=dt?string expected="2010-05-15T06:02:03" /> +<#setting dateTimeFormat="iso m nz"> +<@assertEquals actual=dt?string expected="2010-05-15T01:02" /> + +<#assign d = dt?date> +<#setting dateFormat="xs"> +<@assertEquals actual=d?string expected="2010-05-15-05:00" /> +<#setting dateFormat="iso"> +<@assertEquals actual=d?string expected="2010-05-15" /> +<#setting dateFormat="xs fz"> +<@assertEquals actual=d?string expected="2010-05-15-05:00" /> +<#setting dateFormat="xs fz u"> +<@assertEquals actual=d?string expected="2010-05-15Z" /> +<#setting dateFormat="iso fz u"> +<@assertEquals actual=d?string expected="2010-05-15" /> +<#setting dateFormat="xs nz"> +<@assertEquals actual=d?string expected="2010-05-15" /> + +<#assign t = dt?time> +<@assertEquals actual=d?string expected="2010-05-15" /> +<#setting timeFormat="xs"> +<@assertEquals actual=t?string expected="01:02:03-05:00" /> +<#setting timeFormat="iso_m"> +<@assertEquals actual=t?string expected="01:02-05:00" /> +<#setting timeFormat="xs fz"> +<@assertEquals actual=t?string expected="01:02:03-05:00" /> +<#setting timeFormat="xs nz"> +<@assertEquals actual=t?string expected="01:02:03" /> +<#setting timeFormat="iso nz ms"> +<@assertEquals actual=t?string expected="01:02:03.000" /> + +<@assertFails message="Use ?date, ?time, or ?dateTime">${unknownDate?string.xs}</@> +<@assertFails message="Use ?date, ?time, or ?dateTime">${unknownDate?string.iso}</@> +<@assertFails message="format string">${.now?string.xs_fz_nz}</@> +<@assertFails message="format string">${.now?string.xs_u_fu}</@> +<@assertFails message="format string">${.now?string.xs_s_ms}</@> +<@assertFails message="format string">${.now?string.xs_q}</@> +<@assertFails message="format string">${.now?string.xss}</@> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.ftl deleted file mode 100644 index 5691f82..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-iso-like.ftl +++ /dev/null @@ -1,155 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<#assign d = "2010-05-15 22:38:05:23 +0200"?dateTime("yyyy-MM-dd HH:mm:ss:S Z")> -<#setting timeZone="GMT+02"> -<@assertEquals actual=d?string.xs expected="2010-05-15T22:38:05.023+02:00" /> -<@assertEquals actual=d?string.iso expected="2010-05-15T22:38:05.023+02:00" /> -<@assertEquals actual=d?string('xs') expected="2010-05-15T22:38:05.023+02:00" /> -<@assertEquals actual=d?string('iso') expected="2010-05-15T22:38:05.023+02:00" /> -<@assertEquals actual=d?string.xs_nz expected="2010-05-15T22:38:05.023" /> -<@assertEquals actual=d?string.iso_nz expected="2010-05-15T22:38:05.023" /> -<@assertEquals actual=d?string.xs_fz expected="2010-05-15T22:38:05.023+02:00" /> -<@assertEquals actual=d?string.iso_fz expected="2010-05-15T22:38:05.023+02:00" /> -<@assertEquals actual=d?string.xs_u expected="2010-05-15T20:38:05.023Z" /> -<@assertEquals actual=d?string.iso_u expected="2010-05-15T20:38:05.023Z" /> -<@assertEquals actual=d?string.xs_s_u expected="2010-05-15T20:38:05Z" /> -<@assertEquals actual=d?string.iso_s_u expected="2010-05-15T20:38:05Z" /> - -<@assertEquals actual=d?date?string.xs expected="2010-05-15+02:00" /> -<@assertEquals actual=d?date?string.iso expected="2010-05-15" /> -<@assertEquals actual=d?date?string.xs_nz expected="2010-05-15" /> -<@assertEquals actual=d?date?string.iso_nz expected="2010-05-15" /> -<@assertEquals actual=d?date?string.xs_fz expected="2010-05-15+02:00" /> -<@assertEquals actual=d?date?string.iso_fz expected="2010-05-15" /> - -<@assertEquals actual=d?time?string.xs expected="22:38:05.023+02:00" /> -<@assertEquals actual=d?time?string.iso expected="22:38:05.023+02:00" /> -<@assertEquals actual=d?time?string.xs_nz expected="22:38:05.023" /> -<@assertEquals actual=d?time?string.iso_nz expected="22:38:05.023" /> -<@assertEquals actual=d?time?string.xs_fz expected="22:38:05.023+02:00" /> -<@assertEquals actual=d?time?string.iso_fz expected="22:38:05.023+02:00" /> - -<#-- java.sql treatment --> -<@assertEquals actual=sqlDate?string.xs expected="2010-05-15" /> -<@assertEquals actual=sqlDate?string.iso expected="2010-05-15" /> -<@assertEquals actual=sqlDate?string.xs_fz expected="2010-05-15+02:00" /> -<@assertEquals actual=sqlDate?string.iso_fz expected="2010-05-15" /> -<@assertEquals actual=sqlDate?string.xs_nz expected="2010-05-15" /> -<@assertEquals actual=sqlDate?string.iso_nz expected="2010-05-15" /> -<@assertEquals actual=sqlTime?string.xs expected="22:38:05.023" /> -<@assertEquals actual=sqlTime?string.iso expected="22:38:05.023" /> -<@assertEquals actual=sqlTime?string.xs_fz expected="22:38:05.023+02:00" /> -<@assertEquals actual=sqlTime?string.iso_fz expected="22:38:05.023+02:00" /> -<@assertEquals actual=sqlTime?string.xs_nz expected="22:38:05.023" /> -<@assertEquals actual=sqlTime?string.iso_nz expected="22:38:05.023" /> - -<#assign d = "12:30:15:1 +0200"?time("HH:mm:ss:S Z")> -<@assertEquals actual=d?string.xs expected="12:30:15.001+02:00" /> -<@assertEquals actual=d?string.iso expected="12:30:15.001+02:00" /> -<@assertEquals actual=d?string.xs_ms expected="12:30:15.001+02:00" /> -<@assertEquals actual=d?string.iso_ms expected="12:30:15.001+02:00" /> -<@assertEquals actual=d?string.iso_s expected="12:30:15+02:00" /> -<@assertEquals actual=d?string.iso_m expected="12:30+02:00" /> -<@assertEquals actual=d?string.iso_h expected="12+02:00" /> -<#assign d = "12:30:15:10 +0200"?time("HH:mm:ss:S Z")> -<@assertEquals actual=d?string.xs expected="12:30:15.01+02:00" /> -<@assertEquals actual=d?string.iso expected="12:30:15.01+02:00" /> -<@assertEquals actual=d?string.xs_ms expected="12:30:15.010+02:00" /> -<@assertEquals actual=d?string.iso_ms expected="12:30:15.010+02:00" /> -<#assign d = "12:30:15:100 +0200"?time("HH:mm:ss:S Z")> -<@assertEquals actual=d?string.xs expected="12:30:15.1+02:00" /> -<@assertEquals actual=d?string.iso expected="12:30:15.1+02:00" /> -<@assertEquals actual=d?string.xs_ms expected="12:30:15.100+02:00" /> -<@assertEquals actual=d?string.iso_ms expected="12:30:15.100+02:00" /> -<#assign d = "12:30:15:0 +0200"?time("HH:mm:ss:S Z")> -<@assertEquals actual=d?string.xs expected="12:30:15+02:00" /> -<@assertEquals actual=d?string.iso expected="12:30:15+02:00" /> -<@assertEquals actual=d?string.xs_ms expected="12:30:15.000+02:00" /> -<@assertEquals actual=d?string.iso_ms expected="12:30:15.000+02:00" /> - -<#setting timeZone="GMT+02"> -<#assign d = "2010-05-15"?date("yyyy-MM-dd")> -<@assertEquals actual=d?string.xs expected="2010-05-15+02:00" /> -<@assertEquals actual=d?string.iso expected="2010-05-15" /> -<#setting timeZone="GMT+00"> -<@assertEquals actual=d?string.xs expected="2010-05-14Z" /> -<@assertEquals actual=d?string.iso expected="2010-05-14" /> - -<#setting timeZone="GMT+02:30"> -<#assign d = "2010-05-15"?dateTime("yyyy-MM-dd")> -<@assertEquals actual=d?string.xs expected="2010-05-15T00:00:00+02:30" /> -<@assertEquals actual=d?string.iso expected="2010-05-15T00:00:00+02:30" /> - -<#setting timeZone="GMT-05"> -<#setting locale = "en_US"> -<#assign d = "BC 0001-05-15"?date("G yyyy-MM-dd")> -<#-- Tests that: (a) BC 1 isn't 0 like in ISO 8601; (b) No Julian calendar is used. --> -<@assertEquals actual=d?string.xs expected="-1-05-13-05:00" /> -<@assertEquals actual=d?string.iso expected="0000-05-13" /> - -<#assign dt = "2010-05-15T01:02:03"?dateTime.xs> -<#setting dateTimeFormat="xs"> -<@assertEquals actual=dt?string expected="2010-05-15T01:02:03-05:00" /> -<#setting dateTimeFormat="xs u"> -<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" /> -<#setting dateTimeFormat="iso u"> -<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" /> -<#setting dateTimeFormat="xs fz"> -<@assertEquals actual=dt?string expected="2010-05-15T01:02:03-05:00" /> -<#setting dateTimeFormat="xs fz u"> -<@assertEquals actual=dt?string expected="2010-05-15T06:02:03Z" /> -<#setting dateTimeFormat="xs nz u"> -<@assertEquals actual=dt?string expected="2010-05-15T06:02:03" /> -<#setting dateTimeFormat="iso m nz"> -<@assertEquals actual=dt?string expected="2010-05-15T01:02" /> - -<#assign d = dt?date> -<#setting dateFormat="xs"> -<@assertEquals actual=d?string expected="2010-05-15-05:00" /> -<#setting dateFormat="iso"> -<@assertEquals actual=d?string expected="2010-05-15" /> -<#setting dateFormat="xs fz"> -<@assertEquals actual=d?string expected="2010-05-15-05:00" /> -<#setting dateFormat="xs fz u"> -<@assertEquals actual=d?string expected="2010-05-15Z" /> -<#setting dateFormat="iso fz u"> -<@assertEquals actual=d?string expected="2010-05-15" /> -<#setting dateFormat="xs nz"> -<@assertEquals actual=d?string expected="2010-05-15" /> - -<#assign t = dt?time> -<@assertEquals actual=d?string expected="2010-05-15" /> -<#setting timeFormat="xs"> -<@assertEquals actual=t?string expected="01:02:03-05:00" /> -<#setting timeFormat="iso_m"> -<@assertEquals actual=t?string expected="01:02-05:00" /> -<#setting timeFormat="xs fz"> -<@assertEquals actual=t?string expected="01:02:03-05:00" /> -<#setting timeFormat="xs nz"> -<@assertEquals actual=t?string expected="01:02:03" /> -<#setting timeFormat="iso nz ms"> -<@assertEquals actual=t?string expected="01:02:03.000" /> - -<@assertFails message="Use ?date, ?time, or ?dateTime">${unknownDate?string.xs}</@> -<@assertFails message="Use ?date, ?time, or ?dateTime">${unknownDate?string.iso}</@> -<@assertFails message="format string">${.now?string.xs_fz_nz}</@> -<@assertFails message="format string">${.now?string.xs_u_fu}</@> -<@assertFails message="format string">${.now?string.xs_s_ms}</@> -<@assertFails message="format string">${.now?string.xs_q}</@> -<@assertFails message="format string">${.now?string.xss}</@> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.f3ac ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.f3ac b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.f3ac new file mode 100644 index 0000000..ead21ff --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.f3ac @@ -0,0 +1,75 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<#-- Removes US format differences introduced in Java 9: --> +<#function n(s)> + <#return s?replace('2002,', '2002')?replace('/02,', '/02')?replace(' at', '')> +</#function> +<#setting locale="en_US"> +<#setting timeZone="GMT"> +<#setting dateTimeFormat=""> +${n(date)} +${n(unknownDate?dateTime)} +${n(date?string)} +${n(date?string[""])} +${n(date?string.short)} +${n(date?string.medium)} +${n(date?string.long)} +${n(date?string.short_short)} +${n(date?string.short_medium)} +${n(date?string.short_long)} +${n(date?string.medium_short)} +${n(date?string.medium_medium)} +${n(date?string.medium_long)} +${n(date?string.long_short)} +${n(date?string.long_medium)} +${n(date?string.long_long)} +${n(unknownDate?date)} +${n(date?date?string[""])} +${n(date?date?string.short)} +${n(date?date?string.medium)} +${n(date?date?string.long)} +${n(unknownDate?time)} +${n(date?time?string[""])} +${n(date?time?string.short)} +${n(date?time?string.medium)} +${n(date?time?string.long)} +<#setting locale="hu_hu"> +<#setting dateTimeFormat="long_long"> +${date} +<#setting locale="en_US"> +<#setting dateTimeFormat="EEE, dd MMM yyyyy HH:mm:ss z"> +${date} +${unknownDate?string["EEE, dd MMM yyyy HH:mm:ss z"]} +${unknownDate?string("EEE, dd MMM yyyy HH:mm:ss z")} +${unknownDate?string.yyyy} + +<#setting dateTimeFormat="yyyy"> +<#assign s = date?string> +${s} +<#setting dateTimeFormat="MM"> +${s} + +<#-- Check ?string lazy evaluation bug was fixed: --> +<#setting dateTimeFormat="yyyy"> +<#assign s = date?string> +<#-- no ${s} --> +<#setting dateTimeFormat="MM"> +${s} +<#assign s = date?string> +${s} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/freemarker/blob/81b48221/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.ftl ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.ftl deleted file mode 100644 index ead21ff..0000000 --- a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/templates/dateformat-java.ftl +++ /dev/null @@ -1,75 +0,0 @@ -<#-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<#-- Removes US format differences introduced in Java 9: --> -<#function n(s)> - <#return s?replace('2002,', '2002')?replace('/02,', '/02')?replace(' at', '')> -</#function> -<#setting locale="en_US"> -<#setting timeZone="GMT"> -<#setting dateTimeFormat=""> -${n(date)} -${n(unknownDate?dateTime)} -${n(date?string)} -${n(date?string[""])} -${n(date?string.short)} -${n(date?string.medium)} -${n(date?string.long)} -${n(date?string.short_short)} -${n(date?string.short_medium)} -${n(date?string.short_long)} -${n(date?string.medium_short)} -${n(date?string.medium_medium)} -${n(date?string.medium_long)} -${n(date?string.long_short)} -${n(date?string.long_medium)} -${n(date?string.long_long)} -${n(unknownDate?date)} -${n(date?date?string[""])} -${n(date?date?string.short)} -${n(date?date?string.medium)} -${n(date?date?string.long)} -${n(unknownDate?time)} -${n(date?time?string[""])} -${n(date?time?string.short)} -${n(date?time?string.medium)} -${n(date?time?string.long)} -<#setting locale="hu_hu"> -<#setting dateTimeFormat="long_long"> -${date} -<#setting locale="en_US"> -<#setting dateTimeFormat="EEE, dd MMM yyyyy HH:mm:ss z"> -${date} -${unknownDate?string["EEE, dd MMM yyyy HH:mm:ss z"]} -${unknownDate?string("EEE, dd MMM yyyy HH:mm:ss z")} -${unknownDate?string.yyyy} - -<#setting dateTimeFormat="yyyy"> -<#assign s = date?string> -${s} -<#setting dateTimeFormat="MM"> -${s} - -<#-- Check ?string lazy evaluation bug was fixed: --> -<#setting dateTimeFormat="yyyy"> -<#assign s = date?string> -<#-- no ${s} --> -<#setting dateTimeFormat="MM"> -${s} -<#assign s = date?string> -${s} \ No newline at end of file