ci: fix generic_fn_infer_struct_test.v

master
Delyan Angelov 2022-04-15 21:21:12 +03:00
parent ad231cec2f
commit 675f8b6300
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 18 additions and 27 deletions

View File

@ -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)

View File

@ -12,8 +12,8 @@ fn test_generics_fn_infer_struct() {
assert ret1.contains('Node<int>{')
assert ret1.contains('data: 0')
ret2 := foo(Node<byte>{})
ret2 := foo(Node<u8>{})
println(ret2)
assert ret2.contains('Node<byte>{')
assert ret2.contains('Node<u8>{')
assert ret2.contains('data: 0')
}