Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
updater
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michal Čihař
updater
Commits
0b24a2fb
Verified
Commit
0b24a2fb
authored
Feb 29, 2016
by
Michal 'vorner' Vaner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup: [[ allows newline after it
Make the block strings more readable
parent
178fda03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
tests/backend.lua
tests/backend.lua
+29
-10
No files found.
tests/backend.lua
View file @
0b24a2fb
...
...
@@ -34,16 +34,22 @@ function test_block_parse()
val1
=
"value 1"
,
val2
=
"value 2"
,
val3
=
"value 3"
},
B
.
block_parse
(
[[val1: value 1
},
B
.
block_parse
(
[[
val1: value 1
val2: value 2
val3: value 3]]
))
-- Continuations of fields
assert_table_equal
({
val1
=
[[value 1
val1
=
[[
value 1
line 2
line 3]]
,
val2
=
"value 2"
},
B
.
block_parse
(
[[val1: value 1
},
B
.
block_parse
(
[[
val1: value 1
line 2
line 3
val2: value 2]]
))
...
...
@@ -72,7 +78,9 @@ end
-- Tests for the block_split function.
function
test_block_split
()
-- Just splitting into blocks
blocks_check
(
[[block 1
blocks_check
(
[[
block 1
next line
another line
...
...
@@ -87,7 +95,9 @@ multi line]]})
block 2]]
,
{
'block 1'
,
'block 2'
})
-- Few empty lines at the end - should not produce an empty block
blocks_check
(
[[block 1
blocks_check
(
[[
block 1
block 2
...
...
@@ -107,7 +117,8 @@ function test_package_postprocces()
Depends
=
"libc, kernel (= 3.18.21-1-70ea6b9a4b789c558ac9d579b5c1022f-10), kmod-nls-base"
,
Status
=
"install user installed"
,
Architecture
=
"mpc85xx"
,
Conffiles
=
[[
Conffiles
=
[[
/etc/config/dhcp f81fe9bd228dede2165be71e5c9dcf76cc
/etc/dnsmasq.conf 1e6ab19c1ae5e70d609ac7b6246541d520]]
}
...
...
@@ -251,7 +262,9 @@ function test_pkg_unpack()
-- Check list of extracted files
events_wait
(
run_command
(
function
(
ecode
,
killed
,
stdout
)
assert_equal
(
0
,
ecode
,
"Failed to check the list of files"
)
assert_table_equal
(
lines2set
(
[[.
assert_table_equal
(
lines2set
(
[[
.
./control
./control/conffiles
./control/control
...
...
@@ -283,7 +296,9 @@ function test_pkg_unpack()
]]
),
lines2set
(
stdout
))
end
,
function
()
chdir
(
path
)
end
,
nil
,
-
1
,
-
1
,
"/usr/bin/find"
))
local
files
,
dirs
,
conffiles
,
control
=
B
.
pkg_examine
(
path
)
assert_table_equal
(
lines2set
(
[[/etc/init.d/updater
assert_table_equal
(
lines2set
(
[[
/etc/init.d/updater
/etc/config/updater
/etc/ssl/updater.pem
/usr/share/updater/keys/standby.pem
...
...
@@ -294,7 +309,9 @@ function test_pkg_unpack()
/usr/bin/updater-utils.sh
/usr/bin/updater-worker.sh
/usr/bin/updater-wipe.sh]]
),
files
)
assert_table_equal
(
lines2set
(
[[/
assert_table_equal
(
lines2set
(
[[
/
/etc
/etc/init.d
/etc/cron.d
...
...
@@ -337,7 +354,9 @@ function test_pkg_unpack()
},
ls
(
path
))
events_wait
(
run_command
(
function
(
ecode
,
killed
,
stdout
)
assert_equal
(
0
,
ecode
,
"Failed to check the list of files"
)
assert_table_equal
(
lines2set
(
[[.
assert_table_equal
(
lines2set
(
[[
.
./etc
./etc/config
./etc/config/updater
...
...
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