From b578e60dd52dfb3252ecb83b7855de90b3569e15 Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Fri, 4 Dec 2020 15:43:28 +1100 Subject: [PATCH] tests: add test for fix #cf7b45b --- vlib/v/tests/imported_symbols_test.v | 15 +++++++++++++++ vlib/v/tests/modules/shapes/shapes.v | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 vlib/v/tests/imported_symbols_test.v create mode 100644 vlib/v/tests/modules/shapes/shapes.v diff --git a/vlib/v/tests/imported_symbols_test.v b/vlib/v/tests/imported_symbols_test.v new file mode 100644 index 0000000000..85bc43fb6a --- /dev/null +++ b/vlib/v/tests/imported_symbols_test.v @@ -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] + } + +} \ No newline at end of file diff --git a/vlib/v/tests/modules/shapes/shapes.v b/vlib/v/tests/modules/shapes/shapes.v new file mode 100644 index 0000000000..6d260edf0f --- /dev/null +++ b/vlib/v/tests/modules/shapes/shapes.v @@ -0,0 +1,12 @@ +module shapes + +pub struct Point { +pub mut: + x int + y int +} + +pub struct Line { +pub mut: + ps []Point +} \ No newline at end of file