From 75518e5bb94f553229f4365f65d6516acf56ea67 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 5 Apr 2020 12:55:54 +0300 Subject: [PATCH] ci: extract separate working_with_an_empty_struct_test.v --- .../fn_expecting_ref_but_returning_struct_test.v | 1 + vlib/v/tests/working_with_an_empty_struct_test.v | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 vlib/v/tests/working_with_an_empty_struct_test.v diff --git a/vlib/v/tests/fn_expecting_ref_but_returning_struct_test.v b/vlib/v/tests/fn_expecting_ref_but_returning_struct_test.v index f976458686..e8b73f0b3e 100644 --- a/vlib/v/tests/fn_expecting_ref_but_returning_struct_test.v +++ b/vlib/v/tests/fn_expecting_ref_but_returning_struct_test.v @@ -1,4 +1,5 @@ struct Foo { + x int } pub fn (f Foo) str() string { return 'Foo{}' } diff --git a/vlib/v/tests/working_with_an_empty_struct_test.v b/vlib/v/tests/working_with_an_empty_struct_test.v new file mode 100644 index 0000000000..b8772f6c53 --- /dev/null +++ b/vlib/v/tests/working_with_an_empty_struct_test.v @@ -0,0 +1,12 @@ +struct EmptyStruct {} +pub fn (f EmptyStruct) str() string { return 'EmptyStruct{}' } +fn new_s() EmptyStruct { + println('>get_foo') + return EmptyStruct{} +} + +fn test_using_an_empty_struct_compiles_and_works(){ + s := new_s() + eprintln('s: $s') + assert true +}