tests: simplify the profile_test.v example program to not use `net`
(avoids unrelated openssl dependency)pull/9254/head
parent
d0b89c5675
commit
c15de57f0f
|
@ -1,10 +0,0 @@
|
|||
import net.http
|
||||
|
||||
fn main() {
|
||||
if resp := http.get('http://127.0.0.1:56713/unknown_page') {
|
||||
println(resp.text)
|
||||
} else {
|
||||
println(err)
|
||||
}
|
||||
assert true
|
||||
}
|
|
@ -11,7 +11,7 @@ fn test_vexe_exists() {
|
|||
|
||||
fn test_v_profile_works() {
|
||||
os.chdir(vroot)
|
||||
program_source := os.join_path(vroot, 'vlib/v/tests/profile/calling_http_get.v')
|
||||
program_source := os.join_path(vroot, 'vlib/v/tests/profile/profile_test_1.v')
|
||||
res := os.exec('"$vexe" -profile - run $program_source') or { exit(1) }
|
||||
// eprintln('res: $res')
|
||||
assert res.exit_code == 0
|
||||
|
@ -19,5 +19,5 @@ fn test_v_profile_works() {
|
|||
assert res.output.contains(' os__init_os_args')
|
||||
assert res.output.contains(' main__main')
|
||||
assert res.output.contains(' println')
|
||||
assert res.output.contains(' net__http__get')
|
||||
assert res.output.contains(' strconv__atoi')
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import os
|
||||
import strconv
|
||||
|
||||
fn main() {
|
||||
if n := strconv.atoi(os.args[0]) {
|
||||
println(n)
|
||||
} else {
|
||||
println(err)
|
||||
}
|
||||
assert true
|
||||
}
|
Loading…
Reference in New Issue