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:
parent
b2dc444dd2
commit
42a65e1009
10
vlib/v/tests/modules/submodules/submodules.v
Normal file
10
vlib/v/tests/modules/submodules/submodules.v
Normal file
@ -0,0 +1,10 @@
|
||||
module submodules
|
||||
|
||||
pub struct Main {
|
||||
pub:
|
||||
a string
|
||||
}
|
||||
|
||||
fn init() {
|
||||
println('init submodules')
|
||||
}
|
21
vlib/v/tests/modules/submodules/submodules_test.v
Normal file
21
vlib/v/tests/modules/submodules/submodules_test.v
Normal 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
|
||||
}
|
10
vlib/v/tests/modules/submodules/test/test.v
Normal file
10
vlib/v/tests/modules/submodules/test/test.v
Normal file
@ -0,0 +1,10 @@
|
||||
module test
|
||||
|
||||
pub struct Test {
|
||||
pub:
|
||||
a string
|
||||
}
|
||||
|
||||
fn init() {
|
||||
println('init submodules.test')
|
||||
}
|
10
vlib/v/tests/modules/submodules/test/test2/test2.v
Normal file
10
vlib/v/tests/modules/submodules/test/test2/test2.v
Normal file
@ -0,0 +1,10 @@
|
||||
module test2
|
||||
|
||||
pub struct Test2 {
|
||||
pub:
|
||||
a string
|
||||
}
|
||||
|
||||
fn init() {
|
||||
println('init submodules.test.test2')
|
||||
}
|
Loading…
Reference in New Issue
Block a user