diff --git a/cmd/tools/vtest-fixed.v b/cmd/tools/vtest-fixed.v index 815bbc7670..9c6468d057 100644 --- a/cmd/tools/vtest-fixed.v +++ b/cmd/tools/vtest-fixed.v @@ -12,7 +12,7 @@ const ( 'vlib/v/tests/num_lit_call_method_test.v', 'vlib/v/tests/pointers_test.v', 'vlib/v/tests/type_test.v', - 'vlib/v/tests/valgrind/valgrind_test.v', // ubuntu-musl only + //'vlib/v/tests/valgrind/valgrind_test.v', // ubuntu-musl only 'vlib/v/tests/pointers_str_test.v', 'vlib/net/http/http_httpbin_test.v', // fails on ubuntu-musl, because of missing openssl 'vlib/net/http/http_test.v', // fails on ubuntu-musl, because of missing openssl diff --git a/vlib/v/tests/type_test.v b/vlib/v/tests/type_test.v index 4bce10b537..3e8f609024 100644 --- a/vlib/v/tests/type_test.v +++ b/vlib/v/tests/type_test.v @@ -1,26 +1,37 @@ -struct Human { name string } +struct Human { + name string +} -pub fn (h Human) str() string { return 'Human: $h.name' } +fn (h Human) str() string { + return 'Human: $h.name' +} type Person Human fn test_type_print() { - p := Person{'Bilbo'} + p := Person{ + name: 'Bilbo' + } println(p) assert p.str() == 'Human: Bilbo' } -pub fn (h Person) str() string { return 'Person: $h.name' } +fn (h Person) str() string { + return 'Person: $h.name' +} fn test_person_str() { - p := Person{'Bilbo'} + p := Person{ + name: 'Bilbo' + } println(p) assert p.str() == 'Person: Bilbo' } -struct Foo {} +struct Foo { +} -type Expr = Foo | BoolExpr | BinExpr | UnaryExpr | DeclExprA | DeclExprB +type Expr = BinExpr | BoolExpr | DeclExprA | DeclExprB | Foo | UnaryExpr type DeclExpr = DeclExprA | DeclExprB @@ -42,7 +53,9 @@ struct DeclExprB { fn expr1() Expr { mut e := Expr{} - e = BinExpr{'binexpr'} + e = BinExpr{ + name: 'binexpr' + } return e // return BinExpr{} }