From 675f8b6300b456e2c77296c9c0834147e137cda8 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 15 Apr 2022 21:21:12 +0300 Subject: [PATCH] ci: fix generic_fn_infer_struct_test.v --- vlib/v/fmt/tests/types_input.vv | 41 ++++++++------------- vlib/v/tests/generic_fn_infer_struct_test.v | 4 +- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/vlib/v/fmt/tests/types_input.vv b/vlib/v/fmt/tests/types_input.vv index ac01a4adfd..b90e5be8e1 100644 --- a/vlib/v/fmt/tests/types_input.vv +++ b/vlib/v/fmt/tests/types_input.vv @@ -1,36 +1,27 @@ +// Sumtype +type FooBar = Bar | Foo +pub type PublicBar = Bar | Foo | FooBar +type Uint = u16 | u32 | u64 | u8 // This should stay on the same line +type Float = f32 | f64 - // Sumtype - type FooBar= Foo | Bar - pub type PublicBar = Foo | Bar | FooBar - -type Uint = u8 |u16 | u64 - | u32 // This should stay on the same line -type -Float = - f32 | - f64 - - // Alias type - type MyInt = int - - pub type Abc = f32 +// Alias type +type MyInt = int +pub type Abc = f32 // Fn type decl - type EmptyFn = fn() -type OneArgFn = - fn (i int) -type TwoDiffArgs -= fn (i int, s string) bool +type EmptyFn = fn () +type OneArgFn = fn (i int) - type TwoSameArgs = fn(i int, j int) string // And a comment +type TwoDiffArgs = fn (i int, s string) bool -type VarArgs = fn -(s ...string) int +type TwoSameArgs = fn (i int, j int) string // And a comment -type NOVarArgs = fn(i int, s ...string) f64 +type VarArgs = fn (s ...string) int -type NoNameArgs = fn( int, string , ...string) +type NOVarArgs = fn (i int, s ...string) f64 + +type NoNameArgs = fn (int, string, ...string) diff --git a/vlib/v/tests/generic_fn_infer_struct_test.v b/vlib/v/tests/generic_fn_infer_struct_test.v index 3985e1ea67..643d6a6823 100644 --- a/vlib/v/tests/generic_fn_infer_struct_test.v +++ b/vlib/v/tests/generic_fn_infer_struct_test.v @@ -12,8 +12,8 @@ fn test_generics_fn_infer_struct() { assert ret1.contains('Node{') assert ret1.contains('data: 0') - ret2 := foo(Node{}) + ret2 := foo(Node{}) println(ret2) - assert ret2.contains('Node{') + assert ret2.contains('Node{') assert ret2.contains('data: 0') }