fix repl tests
parent
32fbc2bdf3
commit
e081791eaf
|
@ -9,3 +9,7 @@
|
||||||
// res.free()
|
// res.free()
|
||||||
// conn.close()
|
// conn.close()
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -57,3 +57,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -439,7 +439,7 @@ pub fn (v mut V) generate_main() {
|
||||||
cgen.genln('$cgen.fn_main;')
|
cgen.genln('$cgen.fn_main;')
|
||||||
v.gen_main_end('return 0')
|
v.gen_main_end('return 0')
|
||||||
}
|
}
|
||||||
else {
|
else if !v.pref.is_repl {
|
||||||
verror('function `main` is not declared in the main module')
|
verror('function `main` is not declared in the main module')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -453,7 +453,9 @@ pub fn (v mut V) generate_main() {
|
||||||
// Generate a C `main`, which calls every single test function
|
// Generate a C `main`, which calls every single test function
|
||||||
v.gen_main_start(false)
|
v.gen_main_start(false)
|
||||||
|
|
||||||
if v.pref.is_stats { cgen.genln('BenchedTests bt = main__start_testing();') }
|
if v.pref.is_stats {
|
||||||
|
cgen.genln('BenchedTests bt = main__start_testing();')
|
||||||
|
}
|
||||||
|
|
||||||
for _, f in v.table.fns {
|
for _, f in v.table.fns {
|
||||||
if f.name.starts_with('main__test_') {
|
if f.name.starts_with('main__test_') {
|
||||||
|
|
Loading…
Reference in New Issue