vlang/rfcs

[REJECTED] [test] attribute replacing fn test_f()

igotfr opened this issue · 4 comments

[test]
fn f() {
  assert 2 == 2
}

// instead
fn test_f() {
  assert 2 == 2
}

related:
vlang/v#11924

Having 2 functions with the same name seems worse than what we have now, doesn't it?

Having 2 functions with the same name seems worse than what we have now, doesn't it?

it's easier to find quickly in the middle of the code and to differentiate too

The test_ prefix for test functions is preferable - it is easier and simpler to find such functions for both humans and for the test framework too.