mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
http: refactor and reduce duplication
This commit is contained in:

committed by
Alexander Medvednikov

parent
756c6d2858
commit
84a6c019e8
@ -2,16 +2,11 @@ module main
|
||||
|
||||
import net.ftp
|
||||
|
||||
fn test_ftp_client() {
|
||||
make_client_connection()
|
||||
assert true
|
||||
}
|
||||
|
||||
// NB: this function makes network calls to external servers,
|
||||
// that is why it is not a very good idea to run it in CI.
|
||||
// If you want to run it manually, use `v -d network vlib/net/ftp/ftp_test.v`
|
||||
[if network]
|
||||
fn make_client_connection() {
|
||||
fn test_ftp_client() {
|
||||
// $if !network ? { return }
|
||||
mut ftp := ftp.new()
|
||||
defer {
|
||||
ftp.close()
|
||||
|
Reference in New Issue
Block a user