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:
parent
a3046b68da
commit
b495e78f0e
@ -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++
|
||||||
|
|
||||||
|
@ -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; }')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user