/
collectPrimitiveProcedureTest.stg
47 lines (37 loc) · 1.52 KB
/
collectPrimitiveProcedureTest.stg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import "copyright.stg"
import "primitiveLiteral.stg"
skipBoolean() ::= "true"
isTest() ::= "true"
targetPath() ::= "org/eclipse/collections/impl/block/procedure/primitive"
fileName(primitive) ::= "Collect<primitive.name>ProcedureTest"
class(primitive) ::= <<
<body(primitive.type, primitive.wrapperName, primitive.name)>
>>
body(type, wrapperName, name) ::= <<
<copyright()>
package org.eclipse.collections.impl.block.procedure.primitive;
import org.eclipse.collections.api.block.function.primitive.<name>Function;
import org.eclipse.collections.api.list.primitive.Immutable<name>List;
import org.eclipse.collections.api.list.primitive.Mutable<name>List;
import org.eclipse.collections.impl.factory.primitive.<name>Lists;
import org.junit.Assert;
import org.junit.Test;
/**
* This file was automatically generated from template file CollectPrimitiveProcedureTest.stg.
*/
public class Collect<name>ProcedureTest
{
@Test
public void basicCase()
{
<name>Function\<String> stringToLengthFunction = (String string) -> <(castIntToNarrowType.(type))("string.length()")>;
Mutable<name>List targetList = <name>Lists.mutable.empty();
Collect<name>Procedure\<String> procedure = new Collect<name>Procedure(stringToLengthFunction, targetList);
procedure.value("");
procedure.value("0");
procedure.value("00");
Immutable<name>List expected = <name>Lists.immutable.with(<["0", "1", "2"]:(literal.(type))(); separator=", ">);
Assert.assertEquals(expected, targetList);
}
}
>>