vlang / rfcs

RFCs for changes to V

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

igotfr opened this issue · comments

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

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

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.