mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: add test for fix #cf7b45b
This commit is contained in:
parent
da1c361cfe
commit
b578e60dd5
15
vlib/v/tests/imported_symbols_test.v
Normal file
15
vlib/v/tests/imported_symbols_test.v
Normal file
@ -0,0 +1,15 @@
|
||||
module main
|
||||
|
||||
import shapes { Point, Line }
|
||||
|
||||
// test that Point & Line work correctly
|
||||
// with struct init & array's
|
||||
fn test_imported_symbols() {
|
||||
p0 := Point {x: 10 y: 10}
|
||||
p1 := Point {x: 50 y: 10}
|
||||
|
||||
_ := Line {
|
||||
ps: [p0, p1]
|
||||
}
|
||||
|
||||
}
|
12
vlib/v/tests/modules/shapes/shapes.v
Normal file
12
vlib/v/tests/modules/shapes/shapes.v
Normal file
@ -0,0 +1,12 @@
|
||||
module shapes
|
||||
|
||||
pub struct Point {
|
||||
pub mut:
|
||||
x int
|
||||
y int
|
||||
}
|
||||
|
||||
pub struct Line {
|
||||
pub mut:
|
||||
ps []Point
|
||||
}
|
Loading…
Reference in New Issue
Block a user