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

tests: add submodules tests (#9640)

This commit is contained in:
Carlos Esquerdo Bernat 2021-04-23 16:22:24 +02:00 committed by GitHub
parent b2dc444dd2
commit 42a65e1009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,10 @@
module submodules
pub struct Main {
pub:
a string
}
fn init() {
println('init submodules')
}

View File

@ -0,0 +1,21 @@
import submodules
import submodules.test
import submodules.test.test2
fn test_main() {
println('main')
main := submodules.Main{
a: 'main'
}
assert 'main' == main.a
test := test.Test{
a: 'test'
}
assert 'test' == test.a
test2 := test2.Test2{
a: 'test2'
}
assert 'test2' == test2.a
}

View File

@ -0,0 +1,10 @@
module test
pub struct Test {
pub:
a string
}
fn init() {
println('init submodules.test')
}

View File

@ -0,0 +1,10 @@
module test2
pub struct Test2 {
pub:
a string
}
fn init() {
println('init submodules.test.test2')
}