mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-14 16:35:03 +01:00
move tests
This commit is contained in:
parent
970b713cf6
commit
3b916d8f69
4 changed files with 0 additions and 0 deletions
25
ui-tests/type/item_tys.nil
Normal file
25
ui-tests/type/item_tys.nil
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//@check-pass
|
||||
|
||||
type A = struct {
|
||||
b: B,
|
||||
c: C,
|
||||
};
|
||||
|
||||
type B = struct {};
|
||||
|
||||
type C = struct {
|
||||
b: B,
|
||||
};
|
||||
|
||||
function test(a: A): A = a;
|
||||
|
||||
function main() = (
|
||||
let a = A {
|
||||
b: B {},
|
||||
c: C {
|
||||
b: B {},
|
||||
}
|
||||
};
|
||||
|
||||
test(a);
|
||||
);
|
||||
21
ui-tests/type/struct_fields.nil
Normal file
21
ui-tests/type/struct_fields.nil
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
//@check-pass
|
||||
|
||||
type A = struct { a: Int };
|
||||
type Complex = struct {
|
||||
a: Int,
|
||||
b: (Int, A),
|
||||
};
|
||||
|
||||
function main() = (
|
||||
let a = A { a: 0 };
|
||||
// let b = 0;
|
||||
// let c = Complex { a: 0, b: (0, a) };
|
||||
|
||||
write(a);
|
||||
|
||||
// c.b.1.a = 1; TODO
|
||||
);
|
||||
|
||||
function write(a: A) = a.a = 1;
|
||||
|
||||
function ret(): A = A { a: 0 };
|
||||
7
ui-tests/type/type_alias.nil
Normal file
7
ui-tests/type/type_alias.nil
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//@check-pass
|
||||
|
||||
type A = (Int, Int);
|
||||
|
||||
function main() = (
|
||||
let a: A = (0, 0);
|
||||
);
|
||||
21
ui-tests/type/type_assignments.nil
Normal file
21
ui-tests/type/type_assignments.nil
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
//@check-pass
|
||||
|
||||
type CustomType = struct {};
|
||||
|
||||
function main() = ();
|
||||
|
||||
function assigns(
|
||||
a: Int,
|
||||
b: I32,
|
||||
c: String,
|
||||
d: Bool,
|
||||
e: CustomType,
|
||||
f: (Int, I32),
|
||||
) = (
|
||||
let a1: Int = a;
|
||||
let b1: I32 = b;
|
||||
let c1: String = c;
|
||||
let d1: Bool = d;
|
||||
let e1: CustomType = e;
|
||||
let f1: (Int, I32) = f;
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue