Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1180-ftp-add-tests-for-non-existing-file-folder...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1180-ftp-add-tests-for-non-existing-file-folder.patch of Package erlang
From 2c5c611121a17ed2e1c97fa9707e5c03c6026f3d Mon Sep 17 00:00:00 2001 From: Kiko Fernandez-Reyes <kiko@erlang.org> Date: Mon, 23 Jan 2023 13:47:31 +0100 Subject: [PATCH 3/3] ftp: add tests for non-existing file/folder --- lib/ftp/test/ftp_SUITE.erl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/ftp/test/ftp_SUITE.erl b/lib/ftp/test/ftp_SUITE.erl index e52c4b1525..cf7ba2927d 100644 --- a/lib/ftp/test/ftp_SUITE.erl +++ b/lib/ftp/test/ftp_SUITE.erl @@ -497,17 +497,21 @@ ls() -> "\"test\" directory. We assume that ls never fails, since " "it's output is meant to be read by humans. "}]. ls(Config0) -> - Config = set_state([reset,{mkdir,"test"}], Config0), + TestFileName = "testing-file", + Config = set_state([reset,{mkdir,"test"},{mkfile, TestFileName, TestFileName}], Config0), Pid = proplists:get_value(ftp, Config), {ok, _R1} = ftp:ls(Pid), {ok, _R2} = ftp:ls(Pid, id2ftp("test",Config)), + {ok, _R3} = ftp:nlist(Pid, id2ftp(TestFileName, Config)), + {ok, []} = ftp:nlist(Pid, id2ftp("non-existing-folder",Config)), + {ok, []} = ftp:nlist(Pid, id2ftp("test/non-existing-file",Config)), %% neither nlist nor ls operates on a directory %% they operate on a pathname, which *can* be a %% directory, but can also be a filename or a group %% of files (including wildcards). case proplists:get_value(wildcard_support, Config) of true -> - {ok, _R3} = ftp:ls(Pid, id2ftp("te*",Config)); + {ok, _R4} = ftp:ls(Pid, id2ftp("te*",Config)); _ -> ok end. @@ -519,17 +523,21 @@ nlist() -> "operating systems. On some it is an error to have an empty " "directory."}]. nlist(Config0) -> - Config = set_state([reset,{mkdir,"test"}], Config0), + TestFileName = "testing-file", + Config = set_state([reset,{mkdir,"test"},{mkfile, TestFileName, TestFileName}], Config0), Pid = proplists:get_value(ftp, Config), {ok, _R1} = ftp:nlist(Pid), {ok, _R2} = ftp:nlist(Pid, id2ftp("test",Config)), + {ok, _R3} = ftp:nlist(Pid, id2ftp(TestFileName, Config)), + {ok, []} = ftp:nlist(Pid, id2ftp("non-existing-folder",Config)), + {ok, []} = ftp:nlist(Pid, id2ftp("test/non-existing-file",Config)), %% neither nlist nor ls operates on a directory %% they operate on a pathname, which *can* be a %% directory, but can also be a filename or a group %% of files (including wildcards). case proplists:get_value(wildcard_support, Config) of true -> - {ok, _R3} = ftp:nlist(Pid, id2ftp("te*",Config)); + {ok, _R4} = ftp:nlist(Pid, id2ftp("te*",Config)); _ -> ok end. -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor