ci: fix generic_fn_infer_struct_test.v

Delyan Angelov 2022-04-15 21:21:12 +03:00 committed by Jef Roosens
parent a33fa316b0
commit f1eab54c04
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
2 changed files with 18 additions and 27 deletions

View File

@ -1,35 +1,26 @@
// Sumtype // Sumtype
type FooBar= Foo | Bar type FooBar = Bar | Foo
pub type PublicBar = Foo | Bar | FooBar pub type PublicBar = Bar | Foo | FooBar
type Uint = u8 |u16 | u64 type Uint = u16 | u32 | u64 | u8 // This should stay on the same line
| u32 // This should stay on the same line type Float = f32 | f64
type
Float =
f32 |
f64
// Alias type // Alias type
type MyInt = int type MyInt = int
pub type Abc = f32 pub type Abc = f32
// Fn type decl // Fn type decl
type EmptyFn = fn () type EmptyFn = fn ()
type OneArgFn =
fn (i int)
type TwoDiffArgs
= fn (i int, s string) bool
type OneArgFn = fn (i int)
type TwoDiffArgs = fn (i int, s string) bool
type TwoSameArgs = fn (i int, j int) string // And a comment type TwoSameArgs = fn (i int, j int) string // And a comment
type VarArgs = fn type VarArgs = fn (s ...string) int
(s ...string) int
type NOVarArgs = fn (i int, s ...string) f64 type NOVarArgs = fn (i int, s ...string) f64

View File

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