Skip to content

Commit 69c1bf5

Browse files
committed
Add array coercion test
1 parent 7bdb7ee commit 69c1bf5

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

snap-compile/src/test/java/org/snapscript/compile/ArrayCoercionTest.java

+12-7
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@ public class ArrayCoercionTest extends TestCase {
5252
" }\n"+
5353
"}\n"+
5454
"var array1: Score[] = [new Score(1.1), new Score(1.0), new Score(2.0)];\n"+
55-
"//var list1: [] = array1;\n"+
56-
"//var array2: [] = list1;\n"+
57-
"//var list2: [] = array2;\n"+
55+
"var array2: Comparable[] = array1;\n"+
56+
"var array3: Score[] = array2;\n"+
57+
"var array4: Comparable[] = array3;\n"+
5858
"\n"+
59-
"println(array1);\n"+
60-
"//println(list1);\n"+
61-
"//println(array2);\n"+
62-
"//println(list2);\n";
59+
"println(array1);\n"+
60+
"println(array1.class);\n"+
61+
"println(array2);\n"+
62+
"println(array2.class);\n"+
63+
"println(array3);\n"+
64+
"println(array3.class);\n"+
65+
"println(array4);\n"+
66+
"println(array4.class);\n";
6367

6468
public void testArrayCoercion() throws Exception {;
6569
Compiler compiler = ClassPathCompilerBuilder.createCompiler();
@@ -70,6 +74,7 @@ public class ArrayCoercionTest extends TestCase {
7074
public void testScopeArrayCoercion() throws Exception {;
7175
Compiler compiler = ClassPathCompilerBuilder.createCompiler();
7276
Executable executable = compiler.compile(SOURCE_2);
77+
System.err.println(SOURCE_2);
7378
executable.execute();
7479
}
7580
}

0 commit comments

Comments
 (0)