1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/compiler/tests/defer_test.v

17 lines
237 B
Go
Raw Normal View History

2019-07-21 01:49:34 +03:00
fn foo() string {
println('foo()')
return 'foo'
}
fn foo2() string {
println('start')
defer { println('defer') }
2019-07-21 17:34:21 +03:00
defer { println('defer2') }
2019-07-21 01:49:34 +03:00
println('end')
return foo()
}
fn test_defer() {
assert foo2() == 'foo'
}