tests: bring back valgrind test

pull/4688/head
Alexander Medvednikov 2020-05-03 13:12:05 +02:00
parent 8df7637853
commit 16fe8103ba
2 changed files with 22 additions and 9 deletions

View File

@ -12,7 +12,7 @@ const (
'vlib/v/tests/num_lit_call_method_test.v', 'vlib/v/tests/num_lit_call_method_test.v',
'vlib/v/tests/pointers_test.v', 'vlib/v/tests/pointers_test.v',
'vlib/v/tests/type_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/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_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 'vlib/net/http/http_test.v', // fails on ubuntu-musl, because of missing openssl

View File

@ -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 type Person Human
fn test_type_print() { fn test_type_print() {
p := Person{'Bilbo'} p := Person{
name: 'Bilbo'
}
println(p) println(p)
assert p.str() == 'Human: Bilbo' 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() { fn test_person_str() {
p := Person{'Bilbo'} p := Person{
name: 'Bilbo'
}
println(p) println(p)
assert p.str() == 'Person: Bilbo' 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 type DeclExpr = DeclExprA | DeclExprB
@ -42,7 +53,9 @@ struct DeclExprB {
fn expr1() Expr { fn expr1() Expr {
mut e := Expr{} mut e := Expr{}
e = BinExpr{'binexpr'} e = BinExpr{
name: 'binexpr'
}
return e return e
// return BinExpr{} // return BinExpr{}
} }