Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
eget
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
eget
Commits
3d25e2d3
Commit
3d25e2d3
authored
Nov 11, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve test for eget, add check for globbing
parent
187dff80
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
1 deletion
+57
-1
test_eget_ftp
test/test_eget_ftp
+17
-1
test_glob
test/test_glob
+40
-0
No files found.
test/test_eget_ftp
View file @
3d25e2d3
...
...
@@ -3,6 +3,11 @@
#EGET="bash -x /srv/danil/Projects/eget/eget"
EGET
=
"
$(
pwd
)
/../eget"
check
()
{
[
"
$2
"
!=
"
$3
"
]
&&
echo
"FATAL with '
$1
': result '
$3
' do not match with '
$2
'"
||
echo
"OK for '
$1
' with '
$2
'"
}
test_download
(){
local
URL
=
"
$1
"
#echo "Download $URL"
...
...
@@ -37,7 +42,18 @@ test_download ftp:$UPATH/test01.txt test01.txt
test_download http:
$UPATH
/test01.txt test01.txt
test_download ftp:
$UPATH
/
*
test01.txt test02.txt
test_download http:
$UPATH
/
*
test01.txt test02.txt
test_download http:
$UPATH
/ test01.txt test02.txt
#echo "List: from http:$UPATH/*"
#$EGET --list http:$UPATH/*
L1
=
$(
$EGET
--list
http:
$UPATH
/
*)
L2
=
"test01.txt
test02.txt
test03.txt"
check
"http:
$UPATH
/*"
"
$L1
"
"
$L2
"
#test_download http:$UPATH/ test01.txt test02.txt
#test_download http://updates.etersoft.ru/pub/people/danil/eget_test2/vm-profile.scm
#test_download http://updates.etersoft.ru/pub/people/danil/eget_test2/ #Download index file like a wget #FAIL norm - file name index
#test_download ftp://updates.etersoft.ru/pub/people/danil/eget_test2/ #FAIL norm - file name index
...
...
test/test_glob
0 → 100755
View file @
3d25e2d3
#!/bin/sh
check
()
{
[
"
$2
"
!=
"
$3
"
]
&&
echo
"FATAL with '
$1
': result '
$3
' do not match with '
$2
'"
||
echo
"OK for '
$1
' with '
$2
'"
}
# check man glob
filter_glob
()
{
grep
"^
$(
echo
"
$1
"
|
sed
-e
"s|
\*
|.*|g"
-e
"s|
\?
|.|g"
)
$"
}
test_glob
()
{
local
R1
=
$(
ls
-1
| filter_glob
"
$1
"
)
local
R2
=
$(
ls
$1
)
check
"
$1
"
"
$R1
"
"
$R2
"
}
L
=
$(
mktemp
-d
)
cd
"
$L
"
||
exit
touch
testA.txt
touch
test0.txt
touch
test1.txt
touch
test2.txt
touch
est2.txt
touch
test2.tx
ls
-l
test_glob
"est?.txt"
test_glob
"test?.txt"
test_glob
"test?.tx"
#test_glob "test.*"
test_glob
"test*.txt"
test_glob
"*1.txt"
rm
-rf
"
$L
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment