1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tests: small array/struct test notes & tmp fix

This commit is contained in:
Joe Conigliaro
2020-03-27 20:47:24 +11:00
parent ed42b864c1
commit fd8bb2c95c
3 changed files with 26 additions and 15 deletions

View File

@@ -1,19 +1,19 @@
struct AA {
struct Aa {
mut:
val int
nums []int
}
struct BB {
struct Bb {
mut:
a AA
a Aa
}
struct CC {
struct Cu {
mut:
b BB
b Bb
nums []int
aarr []AA
aarr []Aa
num int
}
@@ -64,7 +64,7 @@ fn test_empty_struct() {
}
fn test_struct_levels() {
mut c := CC{}
mut c := Cu{}
println(c.nums.len)
assert c.nums.len == 0
c.nums << 3
@@ -82,7 +82,7 @@ fn test_struct_levels() {
assert c.b.a.nums[1] == 2
c.b.a.nums[0] = 7
assert c.b.a.nums[0] == 7
c.aarr << AA{
c.aarr << Aa{
val: 8
}
assert c.aarr.len == 1