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

v2: add _vinit to tests' fn main

This commit is contained in:
Alexander Medvednikov 2020-03-25 00:17:39 +01:00
parent a3046b68da
commit b495e78f0e
2 changed files with 14 additions and 13 deletions

View File

@ -77,8 +77,8 @@ pub fn (nn int) str_l(max int) string {
n1 := n / 100 n1 := n / 100
d = ((n - (n1 * 100)) << 1) d = ((n - (n1 * 100)) << 1)
n = n1 n = n1
buf[index--] = digit_pairs[d++] buf[index--] = digit_pairs.str[d++]
buf[index--] = digit_pairs[d] buf[index--] = digit_pairs.str[d]
} }
index++ index++

View File

@ -2233,11 +2233,12 @@ fn (g &Gen) type_default(typ table.Type) string {
pub fn (g mut Gen) write_tests_main() { pub fn (g mut Gen) write_tests_main() {
g.writeln('int main() {') g.writeln('int main() {')
g.writeln('\t_vinit();')
for _, f in g.table.fns { for _, f in g.table.fns {
if !f.name.starts_with('test_') { if !f.name.starts_with('test_') {
continue continue
} }
g.writeln('${f.name}();') g.writeln('\t${f.name}();')
} }
g.writeln('return 0; }') g.writeln('return 0; }')
} }