| 1 | pub struct App { |
| 2 | } |
| 3 | |
| 4 | pub fn (mut app App) app_index() ! { |
| 5 | return error('hhh') |
| 6 | } |
| 7 | |
| 8 | pub fn (mut app App) no_error() { |
| 9 | } |
| 10 | |
| 11 | fn test_main() { |
| 12 | mut app := App{} |
| 13 | mut ret2 := '' |
| 14 | $for method in App.methods { |
| 15 | $if method.is_pub { |
| 16 | app.$method() or { ret2 = err.msg() } |
| 17 | dump(ret2) |
| 18 | } |
| 19 | } |
| 20 | assert ret2 == 'hhh' |
| 21 | } |
| 22 |