Skip to content

Commit 768f1f8

Browse files
committed
Added some more tests
1 parent 8e3526d commit 768f1f8

File tree

7 files changed

+51
-17
lines changed

7 files changed

+51
-17
lines changed

CodeModel/src/main/java/org/openzen/zenscript/codemodel/type/builtin/BuiltinMethodSymbol.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.openzen.zenscript.codemodel.type.builtin;
22

3-
import com.sun.org.apache.xpath.internal.operations.Mod;
43
import org.openzen.zenscript.codemodel.FunctionHeader;
54
import org.openzen.zenscript.codemodel.FunctionParameter;
65
import org.openzen.zenscript.codemodel.Modifiers;
@@ -346,7 +345,6 @@ public enum BuiltinMethodSymbol implements MethodSymbol {
346345
USIZE_SHL(USIZE, SHL, USIZE, USIZE),
347346
USIZE_SHR(USIZE, SHR, USIZE, USIZE),
348347
USIZE_COMPARE(USIZE, COMPARE, INT, USIZE),
349-
USIZE_COMPARE_UINT(USIZE, COMPARE, INT, UINT),
350348
USIZE_TO_BYTE(USIZE, MethodID.caster(BYTE), Modifiers.NONE, BYTE),
351349
USIZE_TO_SBYTE(USIZE, MethodID.caster(SBYTE), Modifiers.NONE, SBYTE),
352350
USIZE_TO_SHORT(USIZE, MethodID.caster(SHORT), Modifiers.NONE, SHORT),

ScriptingEngineTester/src/main/resources/zencode-tests/alias/alias-1.zc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#output: Two is Foo
12
#output: Two is int
23

34
alias Foo as int;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
val byteValue = 1 as byte;
3+
val sbyteValue = 2 as sbyte;
4+
val shortValue = 3 as short;
5+
val ushortValue = 4 as ushort;
6+
val intValue = 5 as int;
7+
val uintValue = 6 as uint;
8+
val longValue = 7 as long;
9+
val ulongValue = 8 as ulong;
10+
val usizeValue = 9 as usize;
11+
12+
println(typeof(byteValue + sbyteValue));
13+
println(byteValue + sbyteValue);
14+
println(typeof(byteValue + shortValue));
15+
println(byteValue + shortValue);
16+
println(typeof(sbyteValue + ushortValue));
17+
println(byteValue + ushortValue);
18+
println(typeof(byteValue + intValue));
19+
println(byteValue + intValue);
20+
println(typeof(sbyteValue + uintValue));
21+
println(byteValue + uintValue);
22+
println(typeof(byteValue + longValue));
23+
println(byteValue + longValue);
24+
println(typeof(sbyteValue + ulongValue));
25+
println(byteValue + ulongValue);
26+
println(typeof(byteValue + usizeValue));
27+
println(byteValue + usizeValue);

ScriptingEngineTester/src/main/resources/zencode-tests/expressions/addition.zc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,25 @@ val usizeValue = 9 as usize;
3333
val floatValue = 10 as float;
3434
val doubleValue = 11 as double;
3535

36-
println(typeof(byteValue + byteValue));
36+
/*println(typeof(byteValue + byteValue));
3737
println(byteValue + byteValue);
38-
/*println(typeof(byteValue + sbyteValue));
39-
println(byteValue + sbyteValue);
40-
println(typeof(byteValue + shortValue));
41-
println(byteValue + shortValue);
38+
println(typeof(sbyteValue + sbyteValue));
39+
println(sbyteValue + sbyteValue);
40+
println(typeof(sbyteValue + shortValue));
41+
println(sbyteValue + shortValue);
4242
println(typeof(byteValue + ushortValue));
4343
println(byteValue + ushortValue);
44-
println(typeof(byteValue + intValue));
45-
println(byteValue + intValue);
44+
println(typeof(sbyteValue + intValue));
45+
println(sbyteValue + intValue);
4646
println(typeof(byteValue + uintValue));
4747
println(byteValue + uintValue);
48-
println(typeof(byteValue + longValue));
49-
println(byteValue + longValue);
48+
println(typeof(sbyteValue + longValue));
49+
println(sbyteValue + longValue);
5050
println(typeof(byteValue + ulongValue));
5151
println(byteValue + ulongValue);
5252
println(typeof(byteValue + usizeValue));
5353
println(byteValue + usizeValue);
5454
println(typeof(byteValue + floatValue));
55-
println(byteValue + floatValue);
55+
println(byteValue + floatValue);*/
5656
println(typeof(byteValue + doubleValue));
57-
println(byteValue + doubleValue);*/
57+
println(byteValue + doubleValue);
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
#output: Undetermined
2-
3-
//Should this error?
41

52
function println(a as string) {
63

74
}
85

9-
println("Hello");
6+
println("Hello");
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#output: 254
2+
3+
println(~(1 as byte));
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#output: false
2+
#output: false
3+
#output: false
4+
5+
val result = !true;
6+
println(result);
7+
println(!true);
8+
println((!true) as string);

0 commit comments

Comments
 (0)