tests: simplify the profile_test.v example program to not use `net`

(avoids unrelated openssl dependency)
pull/9254/head
Delyan Angelov 2021-03-07 11:07:34 +02:00
parent d0b89c5675
commit c15de57f0f
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 13 additions and 12 deletions

View File

@ -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
}

View File

@ -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')
}

View File

@ -0,0 +1,11 @@
import os
import strconv
fn main() {
if n := strconv.atoi(os.args[0]) {
println(n)
} else {
println(err)
}
assert true
}