http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listliteral.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listliteral.txt new file mode 100644 index 0000000..2048ac5 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listliteral.txt @@ -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. + */ +<html> +<head> +<title>FreeMarker: List Literal Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>Now perform a list assignment:</p> + + +The list contains 5 items. + +<p>test1</p> +<p>test23</p> +<p>test45</p> +<p>Hello, world!</p> +<p>hello</p> + +<p>Now update the assignment and repeat:</p> + + +<p>test1</p> +<p>test23</p> +<p>test45</p> +<p>Hello, world!</p> +<p>hello</p> + +<p>Now reassign the list and repeat:</p> + + +<p>bar</p> +<p>Temporary</p> +<p>test1</p> +<p>test23</p> + +<p>Silly, but necessary tests, for one and zero element lists:</p> + + +<p>Hello, world</p> + +<p>Zero item test:</p> + + + +<p>Dumb test for number literals -- these weren't working as expected:</p> + + +<p>1</p> +<p>2</p> +<p>3</p> +<p>5</p> + +</body> +</html>
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/localization.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/localization.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/localization.txt new file mode 100644 index 0000000..bd3c87d --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/localization.txt @@ -0,0 +1,32 @@ +/* + * 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: Localization Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>G'day, mate!</p> + +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/logging.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/logging.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/logging.txt new file mode 100644 index 0000000..4fa6b2a --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/logging.txt @@ -0,0 +1,27 @@ +/* + * 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: Logging Test</title> +</head> +<body> + +A simple test follows: + +ERROR [org.apache.freemarker.core.Template]: message is not a TemplateHashModel, it's a freemarker.template.SimpleScalar. http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/loopvariable.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/loopvariable.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/loopvariable.txt new file mode 100644 index 0000000..25c20ac --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/loopvariable.txt @@ -0,0 +1,54 @@ +/* + * 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. + */ +--- + 2 + - L1 1 + - L2 1: 1; 2; 3; + - L2 2: 1; 2; 3; +* + - L1 2 + - L2 1: 1; 2; 3; + - L2 2: 1; 2; 3; +* + - L1 3 + - L2 1: 1; 2; 3; + - L2 2: 1; 2; 3; +* +* + 1 + - L1 1 + - L2 1: 1; 2; 3; + - L2 2: 1; 2; 3; +* + - L1 2 + - L2 1: 1; 2; 3; + - L2 2: 1; 2; 3; +* + - L1 3 + - L2 1: 1; 2; 3; + - L2 2: 1; 2; 3; +* +* +--- + 1 0.5 + 2 1 + 3 1.5 + 4 2 Last! +123.4 +--- \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros-return.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros-return.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros-return.txt new file mode 100644 index 0000000..5aa47ff --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros-return.txt @@ -0,0 +1,23 @@ +/* + * 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. + */ +m{ +m{ +m{ +b{ +m:b{ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros.txt new file mode 100644 index 0000000..680a08e --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros.txt @@ -0,0 +1,67 @@ +/* + * 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: Function Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>Now perform function tests:</p> + + +<p>Function is defined, now let's call it:</p> + + <a href="/home.html"> + <img src="/images/home.png" border="0" alt="Home"> + </a> + Kilroy was here. + +<p>Again, but with different parameters:</p> + + <a href="/about.html"> + <img src="/image/about-us.jpeg" border="0" alt="About Us"> + </a> + Kilroy was here. + + Good. + +<p>A recursive function call:</p> + + + 0 + 1 + 2 + 3 + +<p>Test "catch-all" macro parameter:</p> + + +foo=a baz=[] +foo=a baz=[bar=b] +foo=a baz=[bar=b, baz=c] + + +Hello World! Today is Monday. + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros2.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros2.txt new file mode 100644 index 0000000..1b4e007 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/macros2.txt @@ -0,0 +1,22 @@ +/* + * 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. + */ +1 1 +2 2 +4 +m3 with d="4" Failed! http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/multimodels.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/multimodels.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/multimodels.txt new file mode 100644 index 0000000..54ec68d --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/multimodels.txt @@ -0,0 +1,93 @@ +/* + * 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: Test of Multiple Model implementations</title> +</head> +<body> + +<p>Let's begin with a simple model:</p> +<p>Hello, world!</p> + +<p>Cool, now get into the first model. This implements a scalar, list, and +hash as a single class. Let's try some tests...</p> + +<p>MultiModel1 as a string!</p> + +<p>Now as a list...</p> + +Model1 value: 0<br /> +Model1 value: 1<br /> +Model1 value: 2<br /> +Model1 value: 3<br /> +Model1 value: 4<br /> +Model1 value: 5<br /> +Model1 value: 6<br /> +Model1 value: 7<br /> +Model1 value: 8<br /> +Model1 value: 9<br /> +Model3 is alive!<br /> + +<p>Index into a list...</p> +<p>Model1 value: 1</p> +<p>List size is: Nasty!</p> +<p>List size is: Nasty!</p> + +<p>Now, again, as a hash. First using dot notation, then using [] notation:</p> + +<p>Selftest of a hash from MultiModel1</p> +<p>Selftest of a hash from MultiModel1</p> + +<p>Now for the tricky stuff... use a model to index into another model...</p> +<p>selftest</p> +<p>Selftest of a hash from MultiModel1</p> +<p>self</p> +<p>Selftest of a hash from MultiModel1</p> + +<p>Same thing, this time a List index...</p> +<p>0</p> +<p>Model1 value: 0</p> +<p>Model1 value: 1</p> + +<p>Now, do the same recursively...</p> +<p>MultiModel1 as a string!</p> +<p>Model2 is alive!</p> +<p>Arguments are:<br />test<br /></p> +<p>Arguments are:<br />MultiModel1 as a string!<br />Selftest of a hash from MultiModel1<br />Hello, world!<br /></p> + +<p>Does this really not work?</p> +<p>Model3 is alive!</p> +<p>Selftest from MultiModel3!</p> +<p>Hello world from MultiModel3!</p> + +<p>(Again, with Hashes)</p> +<p>Model3 is alive!</p> +<p>Selftest from MultiModel3!</p> + +<p>Model3 is alive!</p> +<p>Selftest from MultiModel3!</p> +<p>Selftest from MultiModel3!</p> + +<p>As I suspected! (Manual on Expressions needs updating.)</p> + +<p>Second test on list size</p> +<p>Key size, not the listSize method.</p> +<p>Key size, not the listSize method.</p> +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/nested.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/nested.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/nested.txt new file mode 100644 index 0000000..bcfb104 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/nested.txt @@ -0,0 +1,25 @@ +/* + * 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. + */ + test 3/1: undefined undefined undefined + test 3/2: undefined undefined undefined + test 3/3: undefined undefined undefined + + test 3/1: Y X Count 1 + test 3/2: Y X Count 2 + test 3/3: Y X Count 3 http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-allowsnothing.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-allowsnothing.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-allowsnothing.txt new file mode 100644 index 0000000..b8384c7 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-allowsnothing.txt @@ -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. + */ +fails \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-defaultresolver.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-defaultresolver.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-defaultresolver.txt new file mode 100644 index 0000000..35e7a3e --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-defaultresolver.txt @@ -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. + */ +works \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-optin.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-optin.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-optin.txt new file mode 100644 index 0000000..9d8e883 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/new-optin.txt @@ -0,0 +1,32 @@ +/* + * 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. + */ +works +fails + +works +works + +works +fails + +works +fails + +works +works \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines1.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines1.txt new file mode 100644 index 0000000..bc58731 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines1.txt @@ -0,0 +1,29 @@ +/* + * 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: Newlines Test</title> +</head> +<body> +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines2.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines2.txt new file mode 100644 index 0000000..c131421 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/newlines2.txt @@ -0,0 +1,30 @@ +/* + * 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: Newlines the Second Test</title> +</head> +<body> +<p>A simple test follows:</p> + +<p>Hello, world! +</p> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/noparse.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/noparse.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/noparse.txt new file mode 100644 index 0000000..5e8486c --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/noparse.txt @@ -0,0 +1,54 @@ +/* + * 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: NoParse Test</title> +</head> +<body> + +A simple test follows: + +${message} + +A more rigorous test, showing that we're not faking it: + +${message@#$%&} + + <p>Message exists! + ...and even generates output! + <#if message> + Nested statements are ok, too. + </#if> + </p> + +Here's another edge case, this time, trying to output a <noparse> +inside another <noparse> + + +This is what the noparse instruction looks like: + +<#noparse>This part of the template wont be parsed by the +FreeMarker parser. Instead, it will be treated as verbatim text information, +and output as such.</#noparse> + +The rest of the template appears here. + +Simple. +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-format.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-format.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-format.txt new file mode 100644 index 0000000..a6f8475 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-format.txt @@ -0,0 +1,33 @@ +/* + * 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. + */ +1 +1 +1Â 234Â 567,89 +1234567.886 +1,00 +1 +1234567,89 +1234567.886 +1 +1 +1.000000000000001 +0.0000000000000001 +-0.0000000000000001 +1 +0.0000000000000001 http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-literal.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-literal.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-literal.txt new file mode 100644 index 0000000..b80bc85 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-literal.txt @@ -0,0 +1,79 @@ +/* + * 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: Number Literal Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>Now perform a number assignment:</p> + +1,3 + + +My number is: 1,8 +My float is: 1.800000 +The int part is: 1 + + +1.83 + +<p>Now use numbers in assignment</p> + +6 + +8 + +<p>Try numbers in tests</p> + +MyMessage is not 152, its: 8. + +<if (mymessage > 5)> + MyMessage is greater than five. +</if + + MyMessage is: 8. + +<p>Now for numbers in dynamic keys:</p> + + +one +three + +<p>Numbers in hashes:</p> + +twelve +twelve +twelve + + +<p>Numbers in method calls:</p> + +Single argument value is: 1 +Single argument value is: 1 +Single argument value is: 12 +Single argument value is: 3 +Single argument value is: 3 + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-to-date.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-to-date.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-to-date.txt new file mode 100644 index 0000000..bc8a10e --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/number-to-date.txt @@ -0,0 +1,31 @@ +/* + * 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. + */ +2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z +2011-05-16 == 2011-05-16 +19:47:55.54Z == 19:47:55.54Z + +2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z +2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z +2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z +2011-05-16T19:47:55.54Z == 2011-05-16T19:47:55.54Z +1970-01-01T00:00:01Z == 1970-01-01T00:00:01Z +1970-01-01T00:00:01Z == 1970-01-01T00:00:01Z +1970-01-01T00:00:00Z == 1970-01-01T00:00:00Z + +failed http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/numerical-cast.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/numerical-cast.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/numerical-cast.txt new file mode 100644 index 0000000..3bf6cd0 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/numerical-cast.txt @@ -0,0 +1,462 @@ +/* + * 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. + */ + +?int: + 0?int=0 + 1?int=1 + -1?int=-1 + 0.5?int=0 + 1.5?int=1 + -0.5?int=0 + -1.5?int=-1 + 0.25?int=0 + -0.25?int=0 + 1.75?int=1 + -1.75?int=-1 + 1.01?int=1 + -1.01?int=-1 + 0.01?int=0 + -0.01?int=0 + 127?int=127 + 128?int=128 + -127?int=-127 + -128?int=-128 + 32767?int=32767 + 32768?int=32768 + -32767?int=-32767 + -32768?int=-32768 + 2147483647?int=2147483647 + 2147483648?int=-2147483648 + -2147483647?int=-2147483647 + -2147483648?int=-2147483648 + 4294967295?int=-1 + 4294967296?int=0 + -4294967295?int=1 + -4294967296?int=0 + 2147483647.1?int=2147483647 + 2147483648.1?int=-2147483648 + -2147483647.1?int=-2147483647 + -2147483648.1?int=-2147483648 + 4294967295.1?int=-1 + 4294967296.1?int=0 + -4294967295.1?int=1 + -4294967296.1?int=0 + 2147483647.5?int=2147483647 + 2147483648.5?int=-2147483648 + -2147483647.5?int=-2147483647 + -2147483648.5?int=-2147483648 + 4294967295.5?int=-1 + 4294967296.5?int=0 + -4294967295.5?int=1 + -4294967296.5?int=0 + +?double + 0?double=0 + 1?double=1 + -1?double=-1 + 0.5?double=0.5 + 1.5?double=1.5 + -0.5?double=-0.5 + -1.5?double=-1.5 + 0.25?double=0.25 + -0.25?double=-0.25 + 1.75?double=1.75 + -1.75?double=-1.75 + 1.01?double=1.01 + -1.01?double=-1.01 + 0.01?double=0.01 + -0.01?double=-0.01 + 127?double=127 + 128?double=128 + -127?double=-127 + -128?double=-128 + 32767?double=32767 + 32768?double=32768 + -32767?double=-32767 + -32768?double=-32768 + 2147483647?double=2147483647 + 2147483648?double=2147483648 + -2147483647?double=-2147483647 + -2147483648?double=-2147483648 + 4294967295?double=4294967295 + 4294967296?double=4294967296 + -4294967295?double=-4294967295 + -4294967296?double=-4294967296 + 2147483647.1?double=2147483647.1 + 2147483648.1?double=2147483648.1 + -2147483647.1?double=-2147483647.1 + -2147483648.1?double=-2147483648.1 + 4294967295.1?double=4294967295.1 + 4294967296.1?double=4294967296.1 + -4294967295.1?double=-4294967295.1 + -4294967296.1?double=-4294967296.1 + 2147483647.5?double=2147483647.5 + 2147483648.5?double=2147483648.5 + -2147483647.5?double=-2147483647.5 + -2147483648.5?double=-2147483648.5 + 4294967295.5?double=4294967295.5 + 4294967296.5?double=4294967296.5 + -4294967295.5?double=-4294967295.5 + -4294967296.5?double=-4294967296.5 + +?long + 0?long=0 + 1?long=1 + -1?long=-1 + 0.5?long=0 + 1.5?long=1 + -0.5?long=0 + -1.5?long=-1 + 0.25?long=0 + -0.25?long=0 + 1.75?long=1 + -1.75?long=-1 + 1.01?long=1 + -1.01?long=-1 + 0.01?long=0 + -0.01?long=0 + 127?long=127 + 128?long=128 + -127?long=-127 + -128?long=-128 + 32767?long=32767 + 32768?long=32768 + -32767?long=-32767 + -32768?long=-32768 + 2147483647?long=2147483647 + 2147483648?long=2147483648 + -2147483647?long=-2147483647 + -2147483648?long=-2147483648 + 4294967295?long=4294967295 + 4294967296?long=4294967296 + -4294967295?long=-4294967295 + -4294967296?long=-4294967296 + 2147483647.1?long=2147483647 + 2147483648.1?long=2147483648 + -2147483647.1?long=-2147483647 + -2147483648.1?long=-2147483648 + 4294967295.1?long=4294967295 + 4294967296.1?long=4294967296 + -4294967295.1?long=-4294967295 + -4294967296.1?long=-4294967296 + 2147483647.5?long=2147483647 + 2147483648.5?long=2147483648 + -2147483647.5?long=-2147483647 + -2147483648.5?long=-2147483648 + 4294967295.5?long=4294967295 + 4294967296.5?long=4294967296 + -4294967295.5?long=-4294967295 + -4294967296.5?long=-4294967296 + +?long from date + 1304877615000 = 1304877615000 + +?float + 0?float=0 + 1?float=1 + -1?float=-1 + 0.5?float=0.5 + 1.5?float=1.5 + -0.5?float=-0.5 + -1.5?float=-1.5 + 0.25?float=0.25 + -0.25?float=-0.25 + 1.75?float=1.75 + -1.75?float=-1.75 + 1.01?float=1.00999999 + -1.01?float=-1.00999999 + 0.01?float=0.01 + -0.01?float=-0.01 + 127?float=127 + 128?float=128 + -127?float=-127 + -128?float=-128 + 32767?float=32767 + 32768?float=32768 + -32767?float=-32767 + -32768?float=-32768 + 2147483647?float=2147483648 + 2147483648?float=2147483648 + -2147483647?float=-2147483648 + -2147483648?float=-2147483648 + 4294967295?float=4294967296 + 4294967296?float=4294967296 + -4294967295?float=-4294967296 + -4294967296?float=-4294967296 + 2147483647.1?float=2147483648 + 2147483648.1?float=2147483648 + -2147483647.1?float=-2147483648 + -2147483648.1?float=-2147483648 + 4294967295.1?float=4294967296 + 4294967296.1?float=4294967296 + -4294967295.1?float=-4294967296 + -4294967296.1?float=-4294967296 + 2147483647.5?float=2147483648 + 2147483648.5?float=2147483648 + -2147483647.5?float=-2147483648 + -2147483648.5?float=-2147483648 + 4294967295.5?float=4294967296 + 4294967296.5?float=4294967296 + -4294967295.5?float=-4294967296 + -4294967296.5?float=-4294967296 + +?byte + 0?byte=0 + 1?byte=1 + -1?byte=-1 + 0.5?byte=0 + 1.5?byte=1 + -0.5?byte=0 + -1.5?byte=-1 + 0.25?byte=0 + -0.25?byte=0 + 1.75?byte=1 + -1.75?byte=-1 + 1.01?byte=1 + -1.01?byte=-1 + 0.01?byte=0 + -0.01?byte=0 + 127?byte=127 + 128?byte=-128 + -127?byte=-127 + -128?byte=-128 + 32767?byte=-1 + 32768?byte=0 + -32767?byte=1 + -32768?byte=0 + 2147483647?byte=-1 + 2147483648?byte=0 + -2147483647?byte=1 + -2147483648?byte=0 + 4294967295?byte=-1 + 4294967296?byte=0 + -4294967295?byte=1 + -4294967296?byte=0 + 2147483647.1?byte=-1 + 2147483648.1?byte=0 + -2147483647.1?byte=1 + -2147483648.1?byte=0 + 4294967295.1?byte=-1 + 4294967296.1?byte=0 + -4294967295.1?byte=1 + -4294967296.1?byte=0 + 2147483647.5?byte=-1 + 2147483648.5?byte=0 + -2147483647.5?byte=1 + -2147483648.5?byte=0 + 4294967295.5?byte=-1 + 4294967296.5?byte=0 + -4294967295.5?byte=1 + -4294967296.5?byte=0 + +?short + 0?short=0 + 1?short=1 + -1?short=-1 + 0.5?short=0 + 1.5?short=1 + -0.5?short=0 + -1.5?short=-1 + 0.25?short=0 + -0.25?short=0 + 1.75?short=1 + -1.75?short=-1 + 1.01?short=1 + -1.01?short=-1 + 0.01?short=0 + -0.01?short=0 + 127?short=127 + 128?short=128 + -127?short=-127 + -128?short=-128 + 32767?short=32767 + 32768?short=-32768 + -32767?short=-32767 + -32768?short=-32768 + 2147483647?short=-1 + 2147483648?short=0 + -2147483647?short=1 + -2147483648?short=0 + 4294967295?short=-1 + 4294967296?short=0 + -4294967295?short=1 + -4294967296?short=0 + 2147483647.1?short=-1 + 2147483648.1?short=0 + -2147483647.1?short=1 + -2147483648.1?short=0 + 4294967295.1?short=-1 + 4294967296.1?short=0 + -4294967295.1?short=1 + -4294967296.1?short=0 + 2147483647.5?short=-1 + 2147483648.5?short=0 + -2147483647.5?short=1 + -2147483648.5?short=0 + 4294967295.5?short=-1 + 4294967296.5?short=0 + -4294967295.5?short=1 + -4294967296.5?short=0 + +?floor + 0?floor=0 + 1?floor=1 + -1?floor=-1 + 0.5?floor=0 + 1.5?floor=1 + -0.5?floor=-1 + -1.5?floor=-2 + 0.25?floor=0 + -0.25?floor=-1 + 1.75?floor=1 + -1.75?floor=-2 + 1.01?floor=1 + -1.01?floor=-2 + 0.01?floor=0 + -0.01?floor=-1 + 127?floor=127 + 128?floor=128 + -127?floor=-127 + -128?floor=-128 + 32767?floor=32767 + 32768?floor=32768 + -32767?floor=-32767 + -32768?floor=-32768 + 2147483647?floor=2147483647 + 2147483648?floor=2147483648 + -2147483647?floor=-2147483647 + -2147483648?floor=-2147483648 + 4294967295?floor=4294967295 + 4294967296?floor=4294967296 + -4294967295?floor=-4294967295 + -4294967296?floor=-4294967296 + 2147483647.1?floor=2147483647 + 2147483648.1?floor=2147483648 + -2147483647.1?floor=-2147483648 + -2147483648.1?floor=-2147483649 + 4294967295.1?floor=4294967295 + 4294967296.1?floor=4294967296 + -4294967295.1?floor=-4294967296 + -4294967296.1?floor=-4294967297 + 2147483647.5?floor=2147483647 + 2147483648.5?floor=2147483648 + -2147483647.5?floor=-2147483648 + -2147483648.5?floor=-2147483649 + 4294967295.5?floor=4294967295 + 4294967296.5?floor=4294967296 + -4294967295.5?floor=-4294967296 + -4294967296.5?floor=-4294967297 + +?ceiling + 0?ceiling=0 + 1?ceiling=1 + -1?ceiling=-1 + 0.5?ceiling=1 + 1.5?ceiling=2 + -0.5?ceiling=0 + -1.5?ceiling=-1 + 0.25?ceiling=1 + -0.25?ceiling=0 + 1.75?ceiling=2 + -1.75?ceiling=-1 + 1.01?ceiling=2 + -1.01?ceiling=-1 + 0.01?ceiling=1 + -0.01?ceiling=0 + 127?ceiling=127 + 128?ceiling=128 + -127?ceiling=-127 + -128?ceiling=-128 + 32767?ceiling=32767 + 32768?ceiling=32768 + -32767?ceiling=-32767 + -32768?ceiling=-32768 + 2147483647?ceiling=2147483647 + 2147483648?ceiling=2147483648 + -2147483647?ceiling=-2147483647 + -2147483648?ceiling=-2147483648 + 4294967295?ceiling=4294967295 + 4294967296?ceiling=4294967296 + -4294967295?ceiling=-4294967295 + -4294967296?ceiling=-4294967296 + 2147483647.1?ceiling=2147483648 + 2147483648.1?ceiling=2147483649 + -2147483647.1?ceiling=-2147483647 + -2147483648.1?ceiling=-2147483648 + 4294967295.1?ceiling=4294967296 + 4294967296.1?ceiling=4294967297 + -4294967295.1?ceiling=-4294967295 + -4294967296.1?ceiling=-4294967296 + 2147483647.5?ceiling=2147483648 + 2147483648.5?ceiling=2147483649 + -2147483647.5?ceiling=-2147483647 + -2147483648.5?ceiling=-2147483648 + 4294967295.5?ceiling=4294967296 + 4294967296.5?ceiling=4294967297 + -4294967295.5?ceiling=-4294967295 + -4294967296.5?ceiling=-4294967296 + +?round + 0?round=0 + 1?round=1 + -1?round=-1 + 0.5?round=1 + 1.5?round=2 + -0.5?round=0 + -1.5?round=-1 + 0.25?round=0 + -0.25?round=0 + 1.75?round=2 + -1.75?round=-2 + 1.01?round=1 + -1.01?round=-1 + 0.01?round=0 + -0.01?round=0 + 127?round=127 + 128?round=128 + -127?round=-127 + -128?round=-128 + 32767?round=32767 + 32768?round=32768 + -32767?round=-32767 + -32768?round=-32768 + 2147483647?round=2147483647 + 2147483648?round=2147483648 + -2147483647?round=-2147483647 + -2147483648?round=-2147483648 + 4294967295?round=4294967295 + 4294967296?round=4294967296 + -4294967295?round=-4294967295 + -4294967296?round=-4294967296 + 2147483647.1?round=2147483647 + 2147483648.1?round=2147483648 + -2147483647.1?round=-2147483647 + -2147483648.1?round=-2147483648 + 4294967295.1?round=4294967295 + 4294967296.1?round=4294967296 + -4294967295.1?round=-4294967295 + -4294967296.1?round=-4294967296 + 2147483647.5?round=2147483648 + 2147483648.5?round=2147483649 + -2147483647.5?round=-2147483647 + -2147483648.5?round=-2147483648 + 4294967295.5?round=4294967296 + 4294967296.5?round=4294967297 + -4294967295.5?round=-4294967295 + -4294967296.5?round=-4294967296 http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding1.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding1.txt new file mode 100644 index 0000000..3b5215a --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding1.txt @@ -0,0 +1,27 @@ +/* + * 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. + */ +Output charset: UTF-8 +URL escaping charset: undefined + +a%FE%FF%00%2F%00%25b +a%FE%FF%00%2F%00%25b +a%2F%25b +a%2F%25b +a%FE%FF%00%2F%00%25b +a%2F%25b \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding2.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding2.txt new file mode 100644 index 0000000..6956b6c Binary files /dev/null and b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding2.txt differ http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding3.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding3.txt new file mode 100644 index 0000000..c0369f6 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/output-encoding3.txt @@ -0,0 +1,26 @@ +/* + * 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. + */ +Output charset: ISO-8859-1 +URL escaping charset: UTF-16 + +UTF-16: a%FE%FF%00%2F%00%25b +ISO-8859-1: a%2F%25b +UTF-16: a%FE%FF%00%2F%00%25b +ISO-8859-1: a%2F%25b +ISO-8859-1: a%2F%25b \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/precedence.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/precedence.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/precedence.txt new file mode 100644 index 0000000..b19cb31 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/precedence.txt @@ -0,0 +1,48 @@ +/* + * 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: Operator Precedence Test</title> +</head> +<body> + +@@@@@@@@@@@ + +<br /> +<br /> + +########## + +<br /> +<br /> + +&&&&&&&&&&& + +<br /> +<br /> + +!!!!!!!!!!! + +<br /> +<br /> + +$$$$$$$$$$$ + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/recover.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/recover.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/recover.txt new file mode 100644 index 0000000..880cea3 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/recover.txt @@ -0,0 +1,26 @@ +/* + * 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. + */ + Hello, World + Well, that did not work. + Now we nest another attempt/recover here: + Oops... + Remember, freeMarker sequences are zero-based! Hello, World + Now we check the current error message. + The template is not currently available + The included template had a problem. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/root.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/root.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/root.txt new file mode 100644 index 0000000..041222c --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/root.txt @@ -0,0 +1,44 @@ +/* + * 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: Root Lookup Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>Access the same variable via the root variable (dot syntax):</p> + +<p>Hello, world!</p> + +<p>Access the same variable via the root variable (bracket syntax):</p> + +<p>Hello, world!</p> + +<p>Ensure that root lookups are unaffected by local variables:</p> + + + Hello, world! + Hello, world! Part Deux + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/sequence-builtins.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/sequence-builtins.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/sequence-builtins.txt new file mode 100644 index 0000000..4f7796a --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/sequence-builtins.txt @@ -0,0 +1,404 @@ +/* + * 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. + */ +Sorting scalars: +---------------- + +String order: +- aardvark +- Barbara +- beetroot +- whale +- zeppelin + +First: aardvark +Last: zeppelin +Size 5 + +Numerical order: +- -324 +- -34 +- 0 +- 0.1 +- 0.11 +- 1 +- 5 +- 111 +- 123 +- 543 + +First: -324 +Last: 543 +Size 10 + +Date/time order: +- 06:05 +- 08:05 +- 08:15 +- 18:00 + +Boolean order: +- false +- false +- true +- true + + +Sorting hashes: +--------------- + +Order by name: +- aardvark: 30 +- Barbara: 53 +- beetroot: 0.3 +- whale: 2000 +- zeppelin: -200 + +Order by weight: +- zeppelin: -200 +- beetroot: 0.3 +- aardvark: 30 +- Barbara: 53 +- whale: 2000 + +Order by a.x.v: +- aqweqw +- dfgdf +- qweqw +- utyu + +Order by a.y, which is a date: +- 1998-02-20 +- 1999-01-20 +- 1999-04-19 +- 1999-04-20 + +Reverse: +-------- + +Order by weight desc: +- whale: 2000 +- Barbara: 53 +- aardvark: 30 +- beetroot: 0.3 +- zeppelin: -200 + +Order by weight desc desc: +- zeppelin: -200 +- beetroot: 0.3 +- aardvark: 30 +- Barbara: 53 +- whale: 2000 + +Order by weight desc desc desc: +- whale: 2000 +- Barbara: 53 +- aardvark: 30 +- beetroot: 0.3 +- zeppelin: -200 + +Contains: +--------- + +True: +true +true +true +true +true +true +true + +False: +false +false +false +false +false +false +false + +False: false + +Index_of: +--------- + +0 = 0 +1 = 1 +2 = 2 +6 = 6 +0 = 0 +1 = 1 +2 = 2 + +-1 = -1 +-1 = -1 +-1 = -1 +-1 = -1 +-1 = -1 +-1 = -1 +-1 = -1 + +-1 = -1 + +Last_index_of: +-------------- + +6 = 6 +1 = 1 +2 = 2 +7 = 7 +-1 = -1 +0 = 0 +1 = 1 +2 = 2 +-1 = -1 + +Index_of and last_index_of with starting indices +------------------------------------------------ + +seq_index_of "Joe": +0 = 0 +0 = 0 +0 = 0 +2 = 2 +2 = 2 +-1 = -1 +-1 = -1 + +seq_last_index_of "Joe": +-1 = -1 +-1 = -1 +0 = 0 +0 = 0 +2 = 2 +2 = 2 +2 = 2 + +seq_index_of "Susan": +3 = 3 +3 = 3 +3 = 3 +3 = 3 +3 = 3 +3 = 3 +-1 = -1 + +seq_last_index_of "Susan": +-1 = -1 +-1 = -1 +-1 = -1 +-1 = -1 +-1 = -1 +3 = 3 +3 = 3 + +seq_index_of "a": +0 = 0 +0 = 0 +0 = 0 +-1 = -1 +-1 = -1 +-1 = -1 +-1 = -1 + +seq_index_of "b": +1 = 1 +1 = 1 +1 = 1 +1 = 1 +-1 = -1 +-1 = -1 + +seq_index_of "c": +2 = 2 +2 = 2 +2 = 2 +2 = 2 +2 = 2 +-1 = -1 + +seq_last_index_of "a": +-1 = -1 +-1 = -1 +0 = 0 +0 = 0 +0 = 0 +0 = 0 +0 = 0 + +seq_last_index_of "b": +-1 = -1 +-1 = -1 +-1 = -1 +1 = 1 +1 = 1 +1 = 1 + +seq_last_index_of "c": +-1 = -1 +-1 = -1 +-1 = -1 +-1 = -1 +2 = 2 +2 = 2 + +Sequence builtins ignoring nulls +-------------------------------- + +true = true +2 = 2 +0 = 0 + +These should throw exception, but for BC they don't: +false = false +-1 = -1 +-1 = -1 + +Sequence built-ins failing on date-type mismatch +------------------------------------------------ + + +Chunk +----- + +columns = 1, fill = NULL: + Rows: 7 + a <-- Columns: 1 + b <-- Columns: 1 + c <-- Columns: 1 + d <-- Columns: 1 + e <-- Columns: 1 + f <-- Columns: 1 + g <-- Columns: 1 + +columns = 2, fill = NULL: + Rows: 4 + a b <-- Columns: 2 + c d <-- Columns: 2 + e f <-- Columns: 2 + g <-- Columns: 1 + +columns = 3, fill = NULL: + Rows: 3 + a b c <-- Columns: 3 + d e f <-- Columns: 3 + g <-- Columns: 1 + +columns = 4, fill = NULL: + Rows: 2 + a b c d <-- Columns: 4 + e f g <-- Columns: 3 + +columns = 5, fill = NULL: + Rows: 2 + a b c d e <-- Columns: 5 + f g <-- Columns: 2 + +columns = 10, fill = NULL: + Rows: 1 + a b c d e f g <-- Columns: 7 + +columns = 1, fill = -: + Rows: 7 + a <-- Columns: 1 + b <-- Columns: 1 + c <-- Columns: 1 + d <-- Columns: 1 + e <-- Columns: 1 + f <-- Columns: 1 + g <-- Columns: 1 + +columns = 2, fill = -: + Rows: 4 + a b <-- Columns: 2 + c d <-- Columns: 2 + e f <-- Columns: 2 + g - <-- Columns: 2 + +columns = 3, fill = -: + Rows: 3 + a b c <-- Columns: 3 + d e f <-- Columns: 3 + g - - <-- Columns: 3 + +columns = 4, fill = -: + Rows: 2 + a b c d <-- Columns: 4 + e f g - <-- Columns: 4 + +columns = 5, fill = -: + Rows: 2 + a b c d e <-- Columns: 5 + f g - - - <-- Columns: 5 + +columns = 10, fill = -: + Rows: 1 + a b c d e f g - - - <-- Columns: 10 + +columns = 3, fill = NULL: + Rows: 3 + 1 2 3 <-- Columns: 3 + 4 5 6 <-- Columns: 3 + 7 8 9 <-- Columns: 3 + +columns = 3, fill = -: + Rows: 3 + 1 2 3 <-- Columns: 3 + 4 5 6 <-- Columns: 3 + 7 8 9 <-- Columns: 3 + +columns = 3, fill = NULL: + Rows: 1 + 1 <-- Columns: 1 + +columns = 3, fill = -: + Rows: 1 + 1 - - <-- Columns: 3 + +columns = 3, fill = NULL: + Rows: 0 + +columns = 3, fill = -: + Rows: 0 + + + + +Join +---- + +- 1, two, three, 4 +- +- 1, two, three, 4. +- (empty) +- a, c +- a, c +- a, c. +- +- (empty) +- (empty) +- a, b, c. +- a, b, c. + + +Misc +---- + +First of set 1: a +First of set 2: a \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/specialvars.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/specialvars.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/specialvars.txt new file mode 100644 index 0000000..e2fa13e --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/specialvars.txt @@ -0,0 +1,25 @@ +/* + * 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. + */ +en == en +en_US == en_US +utf-8 == utf-8 +specialvars.ftl == specialvars.ftl +iso-8859-1 == iso-8859-1 +x == x +true == true \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps-matches.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps-matches.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps-matches.txt new file mode 100644 index 0000000..ba14e7f --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps-matches.txt @@ -0,0 +1,99 @@ +/* + * 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. + */ + +List mode: +Size: 4 +[L16][L27][L38][L49] +[L16][L27][L38][L49] + +Iterator mode: +[L16][L27][L38][L49] +[L16(L16, L27, L38, L49)][L27(L16, L27, L38, L49)][L38(L16, L27, L38, L49)][L49(L16, L27, L38, L49)] +[L16][L27][L38][L49] + +Iterator mode changes to list mode: +[L16]/4[L27]/4[L38]/4[L49]/4 +[L16][L27][L38][L49] + +Iterator mode changes to list mode 2: +[L16][L27][L38][L49] +[L16]/4[L27]/4[L38]/4[L49]/4 + +List mode with embedded iteration: +[L16(L16, L27, L38, L49)][L27(L16, L27, L38, L49)][L38(L16, L27, L38, L49)][L49(L16, L27, L38, L49)] + +Entire input match: +- M: L16 + - G: L16 + - G: 1 + - G: 6 +- M: L27 + - G: L27 + - G: 2 + - G: 7 +- M: L38 + - G: L38 + - G: 3 + - G: 8 +- M: L49 + - G: L49 + - G: 4 + - G: 9 +firstGS was: L16, 1, 6 + +Entire input match 2: +Matches: true +- G: x12 +- G: 1 +- G: 2 +As list: +- M: x12 + - G: x12 + - G: 1 + - G: 2 +Groups again: +- G: x12 +- G: 1 +- G: 2 + +Entire input match 3: +Matches: false + +Entire input match 4: +Matches: true +- G: x12 +- G: 1 +- G: 2 + +Substring match nested into entire input match: +- G: x12 ([x12{x12, 1, 2}]) +- G: 1 ([x12{x12, 1, 2}]) +- G: 2 ([x12{x12, 1, 2}]) + +Different entire input and substring matches: +123, 123 +- M: 1 (Gs: 1, 1) +- M: 2 (Gs: 2, 2) +- M: 3 (Gs: 3, 3) + +Different entire input and substring matches 2: +123 +- M: 1 (Gs: 1) +- M: 2 (Gs: 2) +- M: 3 (Gs: 3) http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps.txt new file mode 100644 index 0000000..c54dc96 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins-regexps.txt @@ -0,0 +1,112 @@ +/* + * 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. + */ +true == true +true == true + +false == false +true == true + +false == false +true == true + +false == false +true == true + +false == false +false == false +false == false +true == true +true == true +true == true + +false == false +false == false +true == true +true == true +true == true +true == true + + +Lower 'c'-words: +- coverage +- considered + +Any 'c'-words: +- Code +- coverage +- considered + +Lower line-last words: +- coverage + +Any line-last words: +- coverage +- BROKEN + +Any last words: +- BROKEN + +c-word with follower: +- "Code without" + Groups: "Code without", "Code", "without" +- "coverage\nis" + Groups: "coverage\nis", "coverage", "is" +- "considered to" + Groups: "considered to", "considered", "to" + +c-word with follower in the same line: +- Code without +- considered to + +Lower c-word with follower in the same line: +- considered to + + Ignored but logged in 2.3: False == False + Ignored but logged in 2.3: False == False + +FOObar == FOObar +Foobar == Foobar +FOObar == FOObar +FOObarFOO == FOObarFOO +FOObarfOO == FOObarfOO +FOObarfOO == FOObarfOO +Foobar == Foobar +FOObar == FOObar +FOObarFOO == FOObarFOO +FOObarfOO == FOObarfOO +FOObarfOO == FOObarfOO +foobar == foobar +foobar == foobar +FOObar == FOObar +FOObarFOO == FOObarFOO +FOObarfOo == FOObarfOo +FAlse == FAlse +FAlse == FAlse + + Ignored but logged in 2.3: FOObar + +[foo, barxbaaz] == [foo, barxbaaz] +[foo, barxbaaz] == [foo, barxbaaz] +[foo, bar, baaz] == [foo, bar, baaz] +[foo, barxbaaz] == [foo, barxbaaz] +[foo, bar, baaz] == [foo, bar, baaz] +[fooXXbarxxbaaz] == [fooXXbarxxbaaz] +[foo, bar, baaz] == [foo, bar, baaz] +[F, ls] == [F, ls] +[Fals, ] == [Fals, ] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins1.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins1.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins1.txt new file mode 100644 index 0000000..6e689ac --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins1.txt @@ -0,0 +1,112 @@ +/* + * 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. + */ +FreeMarker: Encoding string built-in tests + + +cap_first: DieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case} +uncap_first: dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case} +uncap_first:blah +capitalize: Diebugsdie! * Vazzze 123456 --cdc-- --<<--@ X ${"kigyo"?upper_case} +html: dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case} +length: 71 +lower_case: diebugsdie! * vazzze 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case} +rtf: dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x $\{"kigyo"?upper_case\} +trim: dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case} +trim2: foo bar +trim3: foo bar +trim4: foo bar +upper_case: DIEBUGSDIE! * VAZZZE 123456 --CDC-- --<<--@ X ${"KIGYO"?UPPER_CASE} +xml: dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x ${"kigyo"?upper_case} +xhtml: "Blah's is > 1 & < 2" + +word_list: +- dieBugsDie! +- * +- vazzZE +- 123456 +- --cdc-- +- --<<--@ +- x +- ${"kigyo"?upper_case} + +interpret: dieBugsDie! * vazzZE 123456 --cdc-- --<<--@ x KIGYO +number: -122,35 +1500 +5 +0 +0 +true +true +true +true +true + +default constructor +1 +xxx +xxx:yyy + + +In The Sacred, Holy beginning, God created The Sacred, Holy Heavens and The Sacred, Holy Earth. +In the very beginning, God created the Heavens and The Earth. +|I|n| |t|h|e| |b|e|g|i|n|n|i|n|g|,| |G|o|d| |c|r|e|a|t|e|d| |t|h|e| |H|e|a|v|e|n|s| |a|n|d| |T|h|e| |E|a|r|t|h|.| +|In the beginning, God created the Heavens and The Earth. + +In the beginning, God created the sky and The Earth. + +matches + + the beginning + the sacred beginning + the Heavens + the sacred Heavens + The Earth + The sacred Earth + +In the beginning, God created the Heavens and The Earth. +beginning +the Heavens and The Earth. + + foo + bar + baz + foobar + + +FOOBAR + +[a] = [a] +[a\\'x'\nb] = [a\\'x'\nb] +[\u0001\u001a ] = [\u0001\u001a ] + +[a] = [a] +[a\\\'x\'\nb] = [a\\\'x\'\nb] +[\x01\x1A ] = [\x01\x1A ] +[\x3C![CDATA[] = [\x3C![CDATA[] +[]]\>] = []]\>] + +[a] = [a] +[a\\'x'\nb] = [a\\'x'\nb] +[\u0001\u001A ] = [\u0001\u001A ] +[\n\r\t\f\b\"] = [\n\r\t\f\b\"] +[\/] = [\/] +[a/b] = [a/b] +[<\/script>] = [<\/script>] +[\u003C![CDATA[] = [\u003C![CDATA[] +[]]\u003E] = []]\u003E] http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins2.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins2.txt new file mode 100644 index 0000000..f5eebd9 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/string-builtins2.txt @@ -0,0 +1,135 @@ +/* + * 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. + */ +-- +1 = 1 +5 = 5 +0 = 0 +-- +5 = 5 +1 = 1 +7 = 7 +-- +true = true +false = false +true = true +-- +true = true +false = false +true = true +-- +true = true +true = true +true = true +false = false +true = true +-- +[abbcdbb] = [abbcdbb] +[qwe] = [qwe] +[qwe] = [qwe] +[qwe] = [qwe] +[qwe +] = [qwe +] +[qwe +] = [qwe +] +-- +[abbcdbb] = [abbcdbb] +[abb-dbb] = [abb-dbb] +[a-=*cd-=*] = [a-=*cd-=*] +-- +[a][][cd][][] == [a][][cd][][] +[][die][maggots][!] == [][die][maggots][!] +[Die maggots!] == [Die maggots!] +-- +[ ] +[ a] +[ ab] +[ abc] +[ abcd] +[abcde] +[abcdef] +[abcdefg] +[abcdefgh] +[-----] +[----a] +[---ab] +[--abc] +[-abcd] +[abcde] +[abcdef] +[abcdefg] +[abcdefgh] +[.oO.oO.o] +[.oO.oO.a] +[.oO.oOab] +[.oO.oabc] +[.oO.abcd] +[.oOabcde] +[.oabcdef] +[.abcdefg] +[abcdefgh] +[abcdefghi] +[abcdefghij] +[] +[/] +[/\] +[/\_] +[/\_/] +[/\_/\] +[/\_/\_] +[/\_/\_/] +-- +[ ] +[a ] +[ab ] +[abc ] +[abcd ] +[abcde] +[abcdef] +[abcdefg] +[abcdefgh] +[-----] +[a----] +[ab---] +[abc--] +[abcd-] +[abcde] +[abcdef] +[abcdefg] +[abcdefgh] +[.oO.oO.o] +[aoO.oO.o] +[abO.oO.o] +[abc.oO.o] +[abcdoO.o] +[abcdeO.o] +[abcdef.o] +[abcdefgo] +[abcdefgh] +[abcdefghi] +[abcdefghij] +[] +[/] +[/\] +[/\_] +[/\_/] +[/\_/\] +[/\_/\_] +[/\_/\_/] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringbimethods.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringbimethods.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringbimethods.txt new file mode 100644 index 0000000..8ef415d --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringbimethods.txt @@ -0,0 +1,29 @@ +/* + * 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. + */ +3.00 +3.00 +01:02:03.000 +01:02:03.000 +--- +de +true false +yes no +igen nem +0.0 1.0 +true true \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringliteral.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringliteral.txt new file mode 100644 index 0000000..3d9d4c9 Binary files /dev/null and b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/stringliteral.txt differ http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/switch.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/switch.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/switch.txt new file mode 100644 index 0000000..5d42785 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/switch.txt @@ -0,0 +1,80 @@ +/* + * 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: Switch-Case Test</title> +</head> +<body> + +<p>Here we iterate over a list of animals.</p> + +<p>Animal is: aardvark.<br /> + This is the HTML for other animals. +</p> +<p>Animal is: kiwi.<br /> + This is the HTML for the user's favorite animal. +</p> +<p>Animal is: gecko.<br /> + This is the HTML for small animals. +</p> +<p>Animal is: cat.<br /> + This is the HTML for other animals. +</p> +<p>Animal is: dog.<br /> + This is the HTML for other animals. +</p> +<p>Animal is: elephant.<br /> + This is the HTML for large animals. +</p> +<p>Animal is: squirrel.<br /> + This is the HTML for small animals. +</p> +<p>Animal is: zebra.<br /> + This is the HTML for a large stripey animal. + This is the HTML for large animals. +</p> + + 1 + i2 + 2 + i4 + ft + ft + 3 + i4 + 3 + i6 + +[] + + "" + "1234" + "234" + "34" + "4" + + "12default45" + "2default45" + "default" + "45" + "5" + + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/transforms.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/transforms.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/transforms.txt new file mode 100644 index 0000000..6b7f986 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/transforms.txt @@ -0,0 +1,68 @@ +/* + * 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: Transformation Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>Hello, world!</p> + +<P>Now try the Utility package:</p> +<p>Utility transformations</p> + +<p>Utility transformations</p> + +<p>Now some nested transforms:</p> +<p >This tests the compress transformation</p ><p >This tests the compress transformation</p ><p >This tests the compress transformation</p > +<p>Now try method and transform interactions:</p> +<p>This isn't a valid XML string.</p> +<p>This isn't a valid HTML string.</p> + +<p>A more advanced interaction involves getting a TemplateMethodModel +to initialise a TemplateTransformModel, as follow:</p> + +Comment: This is a comment + +A test string containing quotes: "This isn't a test". +A test string containing amps: Fish & Chips. +A test string containing tags: <p>Fish & Chips.</p> + +Comment: This is a second comment + +A test string containing quotes: "This isn't a test". +A test string containing amps: Fish & Chips. +A test string containing tags: <p>Fish & Chips.</p> +Comment: This is a third comment + +A test string containing quotes: "This isn't a test". +A test string containing amps: Fish & Chips. +A test string containing tags: <p>Fish &amp; Chips.</p> +Comment: Utility transformations + +A test string containing quotes: "This isn't a test". +A test string containing amps: Fish & Chips. +A test string containing tags: <p>Fish & Chips.</p> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/type-builtins.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/type-builtins.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/type-builtins.txt new file mode 100644 index 0000000..0b4e23a --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/type-builtins.txt @@ -0,0 +1,33 @@ +/* + * 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. + */ +StNuBoMeTaMaHaHxSeCoCxEnInDiNo +1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 +0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 +0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 +0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 +0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 +1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 +0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/var-layers.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/var-layers.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/var-layers.txt new file mode 100644 index 0000000..5fd6e2e --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/var-layers.txt @@ -0,0 +1,37 @@ +/* + * 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. + */ + 1 = 1 + 2 = 2 + 3 = 3 +4 = 4 = 4 +5 = 5 = 5 +6 but 4 = 4 +7 = 7 = 7 +Invisiblity test 1.: passed +Invisiblity test 2.: passed +Invisiblity test 3.: passed +-- + 1 = 1 + 2 = 2 + 3 = 3 + 4 = 4 = 4 = 4 + 5 + 6 == 6 + 7 == 7 == 7 +--
