http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper2.java ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper2.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper2.java deleted file mode 100644 index 96eb1a5..0000000 --- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformMethodWrapper2.java +++ /dev/null @@ -1,64 +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. - */ - -package org.apache.freemarker.test.templatesuite.models; - -import java.util.Iterator; -import java.util.List; - -import org.apache.freemarker.core.model.TemplateMethodModel; - -/** - * Another test of the interaction between MethodModels and TransformModels. - */ -public class TransformMethodWrapper2 implements TemplateMethodModel { - - /** - * Executes a method call. - * - * @param arguments a <tt>List</tt> of <tt>String</tt> objects containing - * the values of the arguments passed to the method. - * @return the <tt>TemplateModel</tt> produced by the method, or null. - */ - @Override - public Object exec(List arguments) { - TransformModel1 cTransformer = new TransformModel1(); - Iterator iArgument = arguments.iterator(); - - // Sets up properties of the Transform model based on the arguments - // passed into this method - - while ( iArgument.hasNext() ) { - String aArgument = (String) iArgument.next(); - - if ( aArgument.equals( "quote" )) { - cTransformer.setQuotes( true ); - } else if ( aArgument.equals( "tag" )) { - cTransformer.setTags( true ); - } else if ( aArgument.equals( "ampersand" )) { - cTransformer.setAmpersands( true ); - } else { - cTransformer.setComment( aArgument ); - } - } - - // Now return the transform class. - return cTransformer; - } -}
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformModel1.java ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformModel1.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformModel1.java deleted file mode 100644 index 0875679..0000000 --- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/TransformModel1.java +++ /dev/null @@ -1,175 +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. - */ - -package org.apache.freemarker.test.templatesuite.models; - -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.io.StringWriter; -import java.io.Writer; -import java.util.Map; - -import org.apache.freemarker.core.model.TemplateTransformModel; - -/** - * A TemplateTransformModel that includes properties. These properties can be - * set at model construction time, or, for the purposes of this demonstration, - * can be passed in from a wrapper TemplateMethodModel. - */ -public class TransformModel1 implements TemplateTransformModel { - - private boolean m_bAmpersands = false; - private boolean m_bQuotes = false; - private boolean m_bTags = false; - private String m_aComment = ""; - - private static final int READER_BUFFER_SIZE = 4096; - - @Override - public Writer getWriter(final Writer out, - final Map args) { - final StringBuilder buf = new StringBuilder(); - return new Writer(out) { - @Override - public void write(char cbuf[], int off, int len) { - buf.append(cbuf, off, len); - } - - @Override - public void flush() { - } - - @Override - public void close() throws IOException { - StringReader sr = new StringReader(buf.toString()); - StringWriter sw = new StringWriter(); - transform(sr, sw); - out.write(sw.toString()); - } - }; - } - - - /** - * Indicates whether we escape ampersands. This property can be set either - * while the model is being constructed, or via a property passed in through - * a <code>TemplateMethodModel</code>. - */ - public void setAmpersands( boolean bAmpersands ) { - m_bAmpersands = bAmpersands; - } - - /** - * Indicates whether we escape quotes. This property can be set either - * while the model is being constructed, or via a property passed in through - * a <code>TemplateMethodModel</code>. - */ - public void setQuotes( boolean bQuotes ) { - m_bQuotes = bQuotes; - } - - /** - * Indicates whether we escape tags. This property can be set either - * while the model is being constructed, or via a property passed in through - * a <code>TemplateMethodModel</code>. - */ - public void setTags( boolean bTags ) { - m_bTags = bTags; - } - - /** - * Sets a comment for this transformation. This property can be set either - * while the model is being constructed, or via a property passed in through - * a <code>TemplateMethodModel</code>. - */ - public void setComment( String aComment ) { - m_aComment = aComment; - } - - /** - * Performs a transformation/filter on FreeMarker output. - * - * @param source the input to be transformed - * @param output the destination of the transformation - */ - public void transform(Reader source, Writer output) - throws IOException { - // Output the source, converting unsafe certain characters to their - // equivalent entities. - int n = 0; - boolean bCommentSent = false; - char[] aBuffer = new char[ READER_BUFFER_SIZE ]; - int i = source.read( aBuffer ); - while (i >= 0) { - for ( int j = 0; j < i; j++ ) { - char c = aBuffer[j]; - switch (c) { - case '&': - if ( m_bAmpersands ) { - output.write("&"); - } else { - output.write( c ); - } - break; - case '<': - if ( m_bTags ) { - output.write("<"); - } else { - output.write( c ); - } - break; - case '>': - if ( m_bTags ) { - output.write(">"); - } else { - output.write( c ); - } - break; - case '"': - if ( m_bQuotes ) { - output.write("""); - } else { - output.write( c ); - } - break; - case '\'': - if ( m_bQuotes ) { - output.write("'"); - } else { - output.write( c ); - } - break; - case '*': - if ( ! bCommentSent ) { - output.write( m_aComment ); - bCommentSent = true; - } else { - output.write( c ); - } - break; - default: - output.write(c); - } - n++; - } - i = source.read( aBuffer ); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/VarArgTestModel.java ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/VarArgTestModel.java b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/VarArgTestModel.java deleted file mode 100644 index 940cb17..0000000 --- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/models/VarArgTestModel.java +++ /dev/null @@ -1,63 +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. - */ - -package org.apache.freemarker.test.templatesuite.models; - -import java.util.Date; - -public class VarArgTestModel { - - public int bar(Integer... xs) { - int sum = 0; - for (Integer x : xs) { - if (x != null) { - sum *= 100; - sum += x; - } - } - return sum; - } - - public int bar2(int first, int... xs) { - int sum = 0; - for (int x : xs) { - sum *= 100; - sum += x; - } - return -(sum * 100 + first); - } - - public int overloaded(int x, int y) { - return x * 100 + y; - } - - public int overloaded(int... xs) { - int sum = 0; - for (int x : xs) { - sum *= 100; - sum += x; - } - return -sum; - } - - public String noVarArgs(String s, boolean b, int i, Date d) { - return s + ", " + b + ", " + i + ", " + d.getTime(); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/package.html ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/package.html b/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/package.html deleted file mode 100644 index cabffb0..0000000 --- a/freemarker-core-test/src/test/java/org/apache/freemarker/test/templatesuite/package.html +++ /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> -</head> -<body> - -<p>JUnit test-suite that processes FreeMarker templates and compare their -output to reference files.</p> - -<p>To add a test-case, go to -<tt>src/test/resources/freemarker/test/templatesuite/</tt> and inside that -directory:</p> -<ol> - <li>Add a template to under <tt>templates/</tt> with whatever meaningful - file name</li> - <li>Add the expected output to <tt>references/</tt> with exactly the same - file name</li> - <li>Add a new <tt>testcase</tt> elemen to <tt>testcases.xml</tt></li> - <li>If you want to add items to the data-model or do something else special, - modify the <tt>setUp()</tt> method in - <tt>src/test/java/freemarker/test/templatesuite/TemplateTestCase.java</tt> - </li> -</ol> -</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/arithmetic.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/arithmetic.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/arithmetic.txt new file mode 100644 index 0000000..33a7186 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/arithmetic.txt @@ -0,0 +1,46 @@ +/* + * 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: Arithmetic Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Perform a number assignment:</p> + + +3.234 +2.00 +0.6172500000000000000000000000000000000000 +1.620089104901 +1.6201 + +<P>Display a number with at least 3 digits after the decimal point</P> + +1234.000 + +<p>Now use numbers in assignment</p> + + +1257.77 + +</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/boolean-formatting.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean-formatting.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean-formatting.txt new file mode 100644 index 0000000..0bab0bc --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean-formatting.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. + */ +Y Y Y +N N N +y y y +n n n +y y y +n n n +str:n str:n +nein ja +theStringValue theStringValue + + + + http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean.txt new file mode 100644 index 0000000..8dc1290 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/boolean.txt @@ -0,0 +1,102 @@ +/* + * 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>Hello, world!</p> + + +<p>Now perform scalar boolean tests:</p> + +<p> + b is true.<br /> +</p> + +<p> This makes sense.<br /> +</p> + +<p> + boolean3 succeeded.<br /> +</p> + +<p> + boolean4 succeeded.<br /> +</p> + +<p> + boolean4 || boolean5 succeeded.<br /> +</p> + +<p> + boolean5 || boolean4 || boolean5 succeeded.<br /> +</p> + +<p> boolean4 && boolean5 failed.<br /> +</p> + +<p>Now test list models:</p> + +<p> + list1 succeeded.<br /> +</p> + +<p> + list2 succeeded.<br /> +</p> + +<p>Test hash models:</p> + +<p> + hash1 succeeded: Hello, world.<br /> +</p> + +<p> + hash2 succeeded.<br /> +</p> + +<p>Test not operator:</p> + +<p> + Not boolean1 succeeded +</p> + +<p> + Not boolean1 succeeded +</p> + +<p> Not boolean2 failed +</p> + +<p> Not boolean2 failed +</p> + +<p> + Message is "Hello, world!" +</p> + +<p> Message is "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/charset-in-header.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/charset-in-header.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/charset-in-header.txt new file mode 100644 index 0000000..4532027 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/charset-in-header.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. + */ +<head> + <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> +</head> +<body> +éáÅű +õÃûà +ÅÅűŰ +</body> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comment.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comment.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comment.txt new file mode 100644 index 0000000..d5902e3 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comment.txt @@ -0,0 +1,34 @@ +/* + * 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> + <p>Message exists! + </p> + +a b +a b + +6 +7 +8 +</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/comparisons.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comparisons.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comparisons.txt new file mode 100644 index 0000000..8d9d372 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/comparisons.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: Numeric Operations Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>Start with the increment operator:</p> +<p>a1 = 0</p> +<p>a1 = 1</p> +<p>a1 = 2</p> + +<p>Now the decrement operator:</p> +<p>a2 = 5</p> +<p>a2 = 4</p> +<p>a2 = 3</p> +<p>a2 = 2</p> +<p>a2 = 1</p> +<p>a2 = 0</p> +<p>a2 = -1</p> + +<p>Now the add operator:</p> +<p>op1 = 5, op2 = 3, op3 = 8</p> +<p>op3 = 11</p> + +<p>And the subtract operator:</p> +<p>op1 = 5, op2 = 3, op3 = 2</p> +<p>op3 = -1</p> + +<p>The comparison operators:</p> + <p>Item is: 0</p> + <p>Item is less than five.</p> + <p>Item is less than or equals to seven.</p> + <p>Item is: 1</p> + <p>Item is less than five.</p> + <p>Item is less than or equals to seven.</p> + <p>Item is: 2</p> + <p>Item is less than five.</p> + <p>Item is less than or equals to seven.</p> + <p>Item is: 3</p> + <p>Item is less than five.</p> + <p>Item is less than or equals to seven.</p> + <p>Item is greater than two.</p> + <p>Item is: 4</p> + <p>Item is less than five.</p> + <p>Item is less than or equals to seven.</p> + <p>Item is greater than two.</p> + <p>Item is: 5</p> + <p>Item is less than or equals to seven.</p> + <p>Item is greater than two.</p> + <p>Item is: 6</p> + <p>Item is less than or equals to seven.</p> + <p>Item is greater than two.</p> + <p>Item is: 7</p> + <p>Item is less than or equals to seven.</p> + <p>Item is greater than two.</p> + <p>Item is: 8</p> + <p>Item is greater than two.</p> + <p>Item is: 9</p> + <p>Item is greater than two.</p> + <p>Item is: 10</p> + <p>Item is greater than two.</p> + <p>Item is greater than or equal to ten.</p> + <p>Item is: 11</p> + <p>Item is greater than two.</p> + <p>Item is greater than or equal to ten.</p> + <p>Item is: 12</p> + <p>Item is greater than two.</p> + <p>Item is greater than or equal to ten.</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/compress.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/compress.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/compress.txt new file mode 100644 index 0000000..43c7eed --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/compress.txt @@ -0,0 +1,40 @@ +/* + * 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>Hello, world!</p> + +<p>This is the same message, using the "compress" tag:</p> +<p>Hello, world!</p> +<p>This is the same message, using the "StandardCompress" transform model:</p> +<p>Hello, world!</p> +<p>This multi-line message should be compressed to a single line.</p> + +<p>An example where the first character is not whitespace but the second character is:</p> +<p>x y</p> + +<p>The end.</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/dateformat-java.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/dateformat-java.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/dateformat-java.txt new file mode 100644 index 0000000..9180262 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/dateformat-java.txt @@ -0,0 +1,55 @@ +/* + * 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. + */ +Nov 15, 2002 2:54:13 PM +Nov 15, 2002 2:54:13 PM +Nov 15, 2002 2:54:13 PM +Nov 15, 2002 2:54:13 PM +11/15/02 2:54 PM +Nov 15, 2002 2:54:13 PM +November 15, 2002 2:54:13 PM GMT +11/15/02 2:54 PM +11/15/02 2:54:13 PM +11/15/02 2:54:13 PM GMT +Nov 15, 2002 2:54 PM +Nov 15, 2002 2:54:13 PM +Nov 15, 2002 2:54:13 PM GMT +November 15, 2002 2:54 PM +November 15, 2002 2:54:13 PM +November 15, 2002 2:54:13 PM GMT +Nov 15, 2002 +Nov 15, 2002 +11/15/02 +Nov 15, 2002 +November 15, 2002 +2:54:13 PM +2:54:13 PM +2:54 PM +2:54:13 PM +2:54:13 PM GMT +2002. november 15. 14:54:13 GMT +Fri, 15 Nov 02002 14:54:13 GMT +Fri, 15 Nov 2002 14:54:13 GMT +Fri, 15 Nov 2002 14:54:13 GMT +2002 + +2002 +2002 + +2002 +11 \ 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/default-object-wrapper.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-object-wrapper.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-object-wrapper.txt new file mode 100644 index 0000000..e015315 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-object-wrapper.txt @@ -0,0 +1,55 @@ +/* + * 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. + */ +array-0 +array-1 +2 +array-0 +array-1 +list-0 +list-1 +list-2 +3 +not empty +list-0 +value +objValue +foo-value +hasfoo +nobaz +bar-value-0 +foo-value +overloaded-int-1 +overloaded-String-String +Message +1974-11-14 +static-method +static-overloaded-int-1 +static-overloaded-String-String +static-final-field +static-field +ONEx +TWOx +THREEx +true +false +false +42 +1 +m + http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-xmlns.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-xmlns.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-xmlns.txt new file mode 100644 index 0000000..3a52c46 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default-xmlns.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. + */ +No NS = No NS +x NS = x NS +y NS = y NS +x NS = x NS + +true + http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default.txt new file mode 100644 index 0000000..fd48463 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/default.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. + */ +foo + +luck + + +0 + + UNDEFINED is undefined. http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/encoding-builtins.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/encoding-builtins.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/encoding-builtins.txt new file mode 100644 index 0000000..ccfe5c8 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/encoding-builtins.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. + */ +FreeMarker: Encoding built-in tests + +html: [&<>"'{}\a/] +xml: [&<>"'{}\a/] +xhtml: [&<>"'{}\a/] +rtf: [&<>"'\{\}\\a/] +html: [a&a<a>a"a'a{a}a\] +xml: [a&a<a>a"a'a{a}a\] +xhtml: [a&a<a>a"a'a{a}a\] +rtf: [a&a<a>a"a'a\{a\}a\\] +html: [<<<<<] +xml: [<<<<<] +xhtml: [<<<<<] +rtf: [\{\{\{\{\{] +html: [] +xml: [] +xhtml: [] +rtf: [] +html: [a] +xml: [a] +xhtml: [a] +rtf: [a] +html: [&] +xml: [&] +xhtml: [&] +rtf: [\{] \ 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/escapes.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/escapes.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/escapes.txt new file mode 100644 index 0000000..c0a5440 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/escapes.txt @@ -0,0 +1,49 @@ +/* + * 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. + */ +a +b +c +a +b +c +a +1 +a +b +c +<&> +&lt;&amp;&gt; +<&> +--- +<Mooo> = <Mooo> + <MOOO> = <MOOO> + <MOOO> = <MOOO> + <MOOO> = <MOOO> + <MOOO> = <MOOO> + <MOOO> = <MOOO> + <Mooo> = <Mooo> + <Mooo> = <Mooo> + <Mooo> = <Mooo> + <Mooo> = <Mooo> + <Mooo> = <Mooo> + <MOOO> = <MOOO> + red green blue +--- + <A&B>[a&b](A&B) <A&B2>[a&b2](A&B2) + <{a&b}A&B>[{a&b}a&b]({a&b}A&B) <{a&b2}A&B2>[{a&b2}a&b2]({a&b2}A&B2) \ 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/exception.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception.txt new file mode 100644 index 0000000..0ea4395 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception.txt @@ -0,0 +1,43 @@ +/* + * 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: Exception Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world! <br /> +freemarker.template.TemplateModelException: Throwing from ExceptionModel! + at freemarker.test.templatesuite.models.ExceptionModel.getAsString(ExceptionModel.java:57) + at freemarker.template.compiler.Expression.getStringValue(Expression.java:65) + at freemarker.template.compiler.DollarVariable.process(DollarVariable.java:62) + at freemarker.template.compiler.NestedTemplateElements.process(NestedTemplateElements.java:76) + at freemarker.template.Template.process(Template.java:266) + at freemarker.template.Template.process(Template.java:289) + at freemarker.test.TestException.runTest(TestException.java:91) + at junit.framework.TestCase.runBare(TestCase.java:140) + at junit.framework.TestResult$1.protect(TestResult.java:106) + at junit.framework.TestResult.runProtected(TestResult.java:124) + at junit.framework.TestResult.run(TestResult.java:109) + at junit.framework.TestCase.run(TestCase.java:131) + at junit.framework.TestSuite.runTest(TestSuite.java:173) + at junit.framework.TestSuite.run(TestSuite.java:168) + at junit.swingui.TestRunner$17.run(TestRunner.java:644) http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception2.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception2.txt new file mode 100644 index 0000000..bf441d3 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception2.txt @@ -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. + */ +<html> +<head> +<title>FreeMarker: Exception Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world! <br /> +<!-- Template Error: Couldn't get value of variable test: Couldn't read string value of test: freemarker.template.TemplateModelException: Throwing from ExceptionModel! + at freemarker.test.templatesuite.models.ExceptionModel.getAsString(ExceptionModel.java:42) + at freemarker.template.expression.Variable.getValue(Variable.java:69) + at freemarker.template.instruction.VariableInstruction.process(VariableInstruction.java:55) + at freemarker.template.compiler.TemplateArrayList.process(TemplateArrayList.java:69) + at freemarker.template.Template.process(Template.java:226) + at freemarker.test.TestException2.runTest(TestException2.java:83) + at junit.framework.TestCase.runBare(TestCase.java:140) + at junit.framework.TestResult$1.protect(TestResult.java:106) + at junit.framework.TestResult.runProtected(TestResult.java:124) + at junit.framework.TestResult.run(TestResult.java:109) + at junit.framework.TestCase.run(TestCase.java:131) + at junit.framework.TestSuite.runTest(TestSuite.java:173) + at junit.framework.TestSuite.run(TestSuite.java:168) + at junit.swingui.TestRunner$17.run(TestRunner.java:644) + --> +</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/exception3.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception3.txt new file mode 100644 index 0000000..6089e87 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exception3.txt @@ -0,0 +1,21 @@ +/* + * 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></head><body bgcolor="#ffffff"> +Template Compilation Error: Identifier expected at line 10. +</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/exthash.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exthash.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exthash.txt new file mode 100644 index 0000000..acb1f78 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/exthash.txt @@ -0,0 +1,76 @@ +/* + * 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: Extended Hash Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>A hash set of 8 animals follows:</p> + +<p> + elephant, + + cat, + + zebra, + + dog, + + aardvark, + + kiwi, + + squirrel, + + gecko. +</p> + +<p>The first animal is an elephant, and the last is a +gecko.</p> + +<p>A hash set of 8 digits follows:<p> + +<p> + six, + + four, + + eight, + + five, + + one, + + two, + + seven, + + three. +</p> + +<p>The zebra number is eight.</p> + +<p>The end.</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/hashconcat.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashconcat.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashconcat.txt new file mode 100644 index 0000000..9736322 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashconcat.txt @@ -0,0 +1,138 @@ +/* + * 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. + */ + +a: + a = 1 + b = 2 + c = 3 + X = 4 + --- + 1 + 2 + 3 + 4 + --- + +B: + d = 10 + e = 20 + f = 30 + X = 40 + --- + 10 + 20 + 30 + 40 + --- + +a + B: + a = 1 + b = 2 + c = 3 + X = 40 + d = 10 + e = 20 + f = 30 + --- + 1 + 2 + 3 + 40 + 10 + 20 + 30 + --- + +B + a: + d = 10 + e = 20 + f = 30 + X = 4 + a = 1 + b = 2 + c = 3 + --- + 10 + 20 + 30 + 4 + 1 + 2 + 3 + --- + +a + a: + a = 1 + b = 2 + c = 3 + X = 4 + --- + 1 + 2 + 3 + 4 + --- + +{} + a: + a = 1 + b = 2 + c = 3 + X = 4 + --- + 1 + 2 + 3 + 4 + --- + +a + {}: + a = 1 + b = 2 + c = 3 + X = 4 + --- + 1 + 2 + 3 + 4 + --- + +{} + {}: + --- + --- + +a + b + {} + b + {} + a: + a = 1 + b = 2 + c = 3 + X = 4 + d = 10 + e = 20 + f = 30 + --- + 1 + 2 + 3 + 4 + 10 + 20 + 30 + --- + + http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashliteral.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashliteral.txt new file mode 100644 index 0000000..3af1052 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/hashliteral.txt @@ -0,0 +1,74 @@ +/* + * 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: Hash Literal Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>Now perform a hash assignment:</p> + + +test23 +Hello, world! +hello all +1 + +<p>Now update the assignment and repeat:</p> + + +test23 +Hello, world! +hello all + +1 + +<p>Now reassign the list and repeat:</p> + + +test23 +Hello, world! + + +1 +Temporary +Temporary +Temporary + +<p>Pathological case: zero item hash:</p> + + + +<p>Hash of number literals:</p> +2 + +<p>Hash concatenation:</p> +a => 1 +b => 3 +c => 4 + +<p>Empty hash concatenation:</p> +foo, bar + +</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/helloworld.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/helloworld.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/helloworld.txt new file mode 100644 index 0000000..b1072fd --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/helloworld.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. + */ +<html> +<head> +<title>FreeMarker: Exec Model 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/identifier-escaping.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-escaping.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-escaping.txt new file mode 100644 index 0000000..1c62bd5 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-escaping.txt @@ -0,0 +1,57 @@ +/* + * 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. + */ + +<a-b>red123</a-b> + +f-a works + +dash-dash-dash etc. +dash-dash-dash etc. +propVal +propVal + +List: 123 + +Switch: OK +ESCAPED + + +as1 +as2 +as3 +as4 +as5 + +<catchAll x=1 y=2 a:b.c=5 data-foo=4 z=3 /> + +---.: = dash-dash-dash etc. +@as@_a = as1 +as/b = as3 +as'c = as4 +as"d = as5 +as-c = as2 +catchAll = ... +dumpNS = ... +f-a = ... +hash = ... +ls:a = ... +m/b2 = ... +m-a = ... +m-b2 = ... +sw-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/identifier-non-ascii.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-non-ascii.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-non-ascii.txt new file mode 100644 index 0000000..8a8d04f --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/identifier-non-ascii.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. + */ +Korean Keyboard http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/if.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/if.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/if.txt new file mode 100644 index 0000000..7c9d1d8 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/if.txt @@ -0,0 +1,104 @@ +/* + * 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. + */ + +- good +- good +- good +- good + +- good +- good + +- good +- good +- good +- good + +- good +- good +- good +- good + +- good +- good +- good +- good + +- good +- good + +- good +- good +- good +- good + +- good +- good +- good +- good + +- 1 +- +- +- is 1 +- isn't 2 +- isn't 3 +- Finally, it's: 1 +- +- 2 +- +- isn't 1 +- is 2 +- isn't 3 +- Finally, it's: 2 +- +- +- 3 +- isn't 1 +- isn't 2 +- is 3 +- Finally, it's: 3 +- +- +- +- isn't 1 +- isn't 2 +- isn't 3 +- Finally, it's: 4 + + 1: + == 1 + 1: + <= 2 + 1: + <= 3 + 2: + > 1 + 2: + == 2 + 2: + <= 3 + 3: + > 1 + 3: + > 2 + 3: + == 3 + End + http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/import.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/import.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/import.txt new file mode 100644 index 0000000..b51a4f4 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/import.txt @@ -0,0 +1,40 @@ +/* + * 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. + */ +-- +-- + + [email protected] + Test bar. + Email: [email protected] + [email protected] + Test bar. + Email: [email protected] + Email in the root: [email protected] + [email protected] + Test bar. + Email: [email protected] + Email in the root: [email protected] + [email protected] [email protected] + +foobarfoobar \ 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/include.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include.txt new file mode 100644 index 0000000..c72d69c --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include.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: Include Instruction Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +Hello, world! + + <p>Message exists! + +<p>Test normal includes:</p> +<p>A test of included files:</p> + + <p>Message exists!:<br /> + Hello, world!</p> + + Can you see me? + +assigning from included template +I'm here, mon! + +Kilroy + Can you see me? Kilroy + +<p>Test subdir includes:</p> +<p>This is include-subdir.ftl</p> +<p>Testing including from same directory</p> +<p>This is include-subdir2.ftl</p> +<p>Testing including from relative parent</p> +<p>A test of included files:</p> + + <p>Message exists!:<br /> + Hello, world!</p> + + Can you see me? +<p>Testing including from loader root</p> +<p>A test of included files:</p> + + <p>Message exists!:<br /> + Hello, world!</p> + + Can you see me? +<p>Testing including through acquisition</p> +<p>This is include-subdir2.ftl</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/include2.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include2.txt new file mode 100644 index 0000000..b7c43a9 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/include2.txt @@ -0,0 +1,28 @@ +/* + * 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. + */ +A próba +A próba + +A próba +A próba +A próba +A próba + +[] +[] http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/interpret.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/interpret.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/interpret.txt new file mode 100644 index 0000000..fe862e6 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/interpret.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. + */ +abcdef +abcdef +abcdef + +M \ 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/iterators.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/iterators.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/iterators.txt new file mode 100644 index 0000000..fb44def --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/iterators.txt @@ -0,0 +1,84 @@ +/* + * 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 Iterator Test</title> +</head> +<body> + +<p>A simple test follows:</p> + +<p>Hello, world!</p> + +<p>Now iterate over a list:</p> + +<p>one</p> +<p>two</p> +<p>three</p> +<p>four</p> +<p>five</p> + +<p>Now iterate again:</p> + +<p>0. one</p> +<p>1. two</p> +<p>2. three</p> +<p>3. four</p> +<p>4. five</p> + +<p>Iterate over a list in a hash:</p> + +<p>one</p> +<p>two</p> +<p>three</p> +<p>four</p> +<p>five</p> + +<p>one</p> +<p>two</p> +<p>three</p> +<p>four</p> +<p>five</p> + +<p>one</p> +<p>two</p> +<p>three</p> +<p>four</p> +<p>five</p> + +<p>one</p> +<p>two</p> +<p>three</p> +<p>four</p> +<p>five</p> + +<p>one</p> +<p>two</p> +<p>three</p> +<p>four</p> +<p>five</p> + +<p>one</p> +<p>two</p> +<p>three</p> +<p>four</p> +<p>five</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/lastcharacter.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/lastcharacter.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/lastcharacter.txt new file mode 100644 index 0000000..dbe5fd0 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/lastcharacter.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. + */ +<html> +<head> +<title>FreeMarker: Last Character Test</title> +</head> +<body> + +<p>A simple test follows:</p> + + 13 + + ELLO, WORLD! + + message: Hello, Worl http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list-bis.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list-bis.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list-bis.txt new file mode 100644 index 0000000..3b9b76d --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list-bis.txt @@ -0,0 +1,51 @@ +/* + * 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. + */ + 0: a [0:A, 1:B, 2:C] + 1: b [0:A, 1:B, 2:C] + 2: c [0:A, 1:B, 2:C] + + 0: a 0a/0A, 0a/1B, 0a/2C + 1: b 1b/0A, 1b/1B, 1b/2C + 2: c 2c/0A, 2c/1B, 2c/2C + +0:a, 1:b, 2:c +1. a; 2. b; 3. c; + +a, b, c +a, b, c + +A, b, c. + +true/false false/true true/false + + <td class="oddRow">a</td> + <td class="evenRow">b</td> + <td class="oddRow">c</td> + + <td class="rowOdd">a</td> + <td class="rowEven">b</td> + <td class="rowOdd">c</td> + + <td class="R">a</td> + <td class="G">b</td> + <td class="B">c</td> + <td class="R">d</td> + <td class="G">e</td> + <td class="B">f</td> + <td class="R">g</td> http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list.txt new file mode 100644 index 0000000..05373bd --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list.txt @@ -0,0 +1,51 @@ +/* + * 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. + */ +Size: 4 +Items: @0 aardvark, @1 bear, @2 cat, @3 dog. + +Size: 1 +Items: @0 aardvark. + +Size: 0 +Items: + +Size: 3 +Items: @0 11, @1 22, @2 33. + +Size: 3 +Items: @0 11, @1 22, @2 33. + +Size: 3 +Items: @0 11, @1 22, @2 33. + +Size: failed +Items: @0 11, @1 22, @2 33. + +Size: 0 +Items: + +Size: 0 +Items: + +Size: 0 +Items: + +Size: failed +Items: + http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list2.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list2.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list2.txt new file mode 100644 index 0000000..cb9e6d4 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list2.txt @@ -0,0 +1,211 @@ +/* + * 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. + */ +=== [aardvark, bear, cat, dog] === + +-- List+sep: + aardvark, + bear, + cat, + dog +-- List+else: + aardvark + bear + cat + dog +-- List+items: + [ + aardvark + bear + cat + dog + ] +-- List+items+else: + [ + aardvark + bear + cat + dog + ] +-- List+items+sep+else: + [ + aardvark, + bear, + cat, + dog + ] +-- + +=== [aardvark] === + +-- List+sep: + aardvark +-- List+else: + aardvark +-- List+items: + [ + aardvark + ] +-- List+items+else: + [ + aardvark + ] +-- List+items+sep+else: + [ + aardvark + ] +-- + +=== [] === + +-- List+sep: +-- List+else: + Empty! +-- List+items: +-- List+items+else: + Empty! +-- List+items+sep+else: + Empty! +-- + +=== [11, 22, 33] === + +-- List+sep: + 11, + 22, + 33 +-- List+else: + 11 + 22 + 33 +-- List+items: + [ + 11 + 22 + 33 + ] +-- List+items+else: + [ + 11 + 22 + 33 + ] +-- List+items+sep+else: + [ + 11, + 22, + 33 + ] +-- + +=== [11, 22, 33] === + +-- List+sep: + 11, + 22, + 33 +-- List+else: + 11 + 22 + 33 +-- List+items: + [ + 11 + 22 + 33 + ] +-- List+items+else: + [ + 11 + 22 + 33 + ] +-- List+items+sep+else: + [ + 11, + 22, + 33 + ] +-- + +=== [11, 22, 33] === + +-- List+sep: + 11, + 22, + 33 +-- List+else: + 11 + 22 + 33 +-- List+items: + [ + 11 + 22 + 33 + ] +-- List+items+else: + [ + 11 + 22 + 33 + ] +-- List+items+sep+else: + [ + 11, + 22, + 33 + ] +-- + +=== [] === + +-- List+sep: +-- List+else: + Empty! +-- List+items: +-- List+items+else: + Empty! +-- List+items+sep+else: + Empty! +-- + +=== [] === + +-- List+sep: +-- List+else: + Empty! +-- List+items: +-- List+items+else: + Empty! +-- List+items+sep+else: + Empty! +-- + +=== [] === + +-- List+sep: +-- List+else: + Empty! +-- List+items: +-- List+items+else: + Empty! +-- List+items+sep+else: + Empty! +-- + http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list3.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list3.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list3.txt new file mode 100644 index 0000000..26fc60d --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/list3.txt @@ -0,0 +1,57 @@ +/* + * 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. + */ +[ + [(11@0, 11@0), (11@0, 22@1), (11@0, 33@2)], + [(22@1, 11@0), (22@1, 22@1), (22@1, 33@2)], + [(33@2, 11@0), (33@2, 22@1), (33@2, 33@2)] +] + + + <p>2 hits: + <div class="hits"> + <div class="hit">a</div> + <div class="hit">b</div> + </div> + + <p>2 hits: + <div class="hits"> + <div class="hitOther">a</div> + <div class="hitOther">b</div> + </div> + + <p>2 hits: + <div class="hits"> + ... + </div> + + <p>Nothing. + +11, 22, ... +[11, 22, ...] + +1, 2, 3 +1 /*first*/, 2, 3 +[1, 2, 3] +1 +1 +[1] +Empty +Empty +Empty + http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4b75ea93/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhash.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhash.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhash.txt new file mode 100644 index 0000000..e251238 --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhash.txt @@ -0,0 +1,157 @@ +/* + * 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. + */ + +Non-empty maps: + + Map: + + [ + k1 = v1 + 2 = v2 + k3 = v3 + null = v4 + Y = v5 + N = null + ] + + [ + k1 = v1; // @0=@0; odd=odd; Y=Y + 2 = v2; // @1=@1; even=even; Y=Y + k3 = v3; // @2=@2; odd=odd; Y=Y + null = v4; // @3=@3; even=even; Y=Y + Y = v5; // @4=@4; odd=odd; Y=Y + N = null // @5=@5; even=even; N=N + ] + + { + [ + k1 = v1; // @0=@0; odd=odd; Y=Y + 2 = v2; // @1=@1; even=even; Y=Y + k3 = v3; // @2=@2; odd=odd; Y=Y + null = v4; // @3=@3; even=even; Y=Y + Y = v5; // @4=@4; odd=odd; Y=Y + N = null // @5=@5; even=even; N=N + ] + } + + Map: + + [ + k1 = v1 + 2 = v2 + k3 = v3 + null = v4 + Y = v5 + N = null + ] + + [ + k1 = v1; // @0=@0; odd=odd; Y=Y + 2 = v2; // @1=@1; even=even; Y=Y + k3 = v3; // @2=@2; odd=odd; Y=Y + null = v4; // @3=@3; even=even; Y=Y + Y = v5; // @4=@4; odd=odd; Y=Y + N = null // @5=@5; even=even; N=N + ] + + { + [ + k1 = v1; // @0=@0; odd=odd; Y=Y + 2 = v2; // @1=@1; even=even; Y=Y + k3 = v3; // @2=@2; odd=odd; Y=Y + null = v4; // @3=@3; even=even; Y=Y + Y = v5; // @4=@4; odd=odd; Y=Y + N = null // @5=@5; even=even; N=N + ] + } + + Map: + + [ + k1 = 11 + k2 = 22 + ] + + [ + k1 = 11; // @0=@0; odd=odd; Y=Y + k2 = 22 // @1=@1; even=even; N=N + ] + + { + [ + k1 = 11; // @0=@0; odd=odd; Y=Y + k2 = 22 // @1=@1; even=even; N=N + ] + } + + +Empty maps: + + Map: + + [ + ] + + [ + Empty + ] + + { + Empty + } + + Map: + + [ + ] + + [ + Empty + ] + + { + Empty + } + + Map: + + [ + ] + + [ + Empty + ] + + { + Empty + } + + + a @ 0, 1 + aa = 11 @ 0 // inside a @ 0, 1 + a @ 0, 1 + -- + b @ 1, 2 + ba = 21 @ 0 // inside b @ 1, 2 + bb = 22 @ 1 // inside b @ 1, 2 + b @ 1, 2 + -- + c @ 2, 0 + c @ 2, 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/listhashliteral.txt ---------------------------------------------------------------------- diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhashliteral.txt b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhashliteral.txt new file mode 100644 index 0000000..937f0ea --- /dev/null +++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templatesuite/expected/listhashliteral.txt @@ -0,0 +1,36 @@ +/* + * 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. + */ + KVPs: + a = 3 + b = 2 + + Keys: + a + b + + Values: + 3 + 2 + + KVPs: + + Keys: + + Values: +
