tests/containers: comments: specs only
This commit is contained in:
1 parent
53aa9a6ebf
commit
70f50917fa
5 files changed
+8
-46
No files matched your search
@@ -1,7 +1,4 @@
|
||||
-- containers/Tar and containers/Archive tests: hand-made headers for the edge cases the reference archives do not hit
|
||||
-- (base-256 numbers, the historical signed checksum, GNU 'K' long links, pax 'g' global records, pax size overrides,
|
||||
-- v7 headers without magic, a missing end-of-archive marker), the writer's GNU / pax extensions (long links, fractional
|
||||
-- and negative mtimes), and Archive helpers (streamName, entries of foreign archive values, failing loaders).
|
||||
-- containers/Tar and Archive tests: hand-made headers for edge cases the reference archives miss, the writer, helpers.
|
||||
local T = require("@tests/T")
|
||||
local Tar = require("@rosetta/containers/Tar")
|
||||
local Archive = require("@rosetta/containers/Archive")
|
||||
@@ -9,7 +6,6 @@ local Err = require("@rosetta/core/Err")
|
||||
|
||||
local t = T.suite("containers/tar")
|
||||
|
||||
-- a header block built by hand
|
||||
local function hdr(fields: { [string]: any }): buffer
|
||||
local h = buffer.create(512)
|
||||
buffer.writestring(h, 0, fields.name or "f")
|
||||
@@ -94,7 +90,6 @@ do
|
||||
t:eq(list[3].uname, "globaluser", "global records apply to later entries")
|
||||
end
|
||||
|
||||
-- errors
|
||||
do
|
||||
local _, e1 = Tar.read(cat({ hdr({ size = "00000002000\0" }), block("x") }))
|
||||
t:check(e1 and e1.code == Err.TRUNCATED, "data past the end: " .. tostring(e1))
|
||||
@@ -109,7 +104,6 @@ do
|
||||
t:check(list and #list == 0, "empty input is an empty archive")
|
||||
end
|
||||
|
||||
-- writer extensions
|
||||
do
|
||||
local long = string.rep("n", 120)
|
||||
for _, fmt in { "gnu", "pax" } do
|
||||
@@ -128,7 +122,6 @@ do
|
||||
t:check(e and e.code == Err.ARG, "empty name")
|
||||
end
|
||||
|
||||
-- Archive helpers
|
||||
do
|
||||
t:eq(Archive.streamName({ name = "/x/y/notes.txt.gz" }, { "gz" }), "notes.txt", "streamName strips the extension")
|
||||
t:eq(Archive.streamName({ name = "a.tbz2" }, { "bz2" }), "a.tar", "streamName .tbz2")
|
||||
|
||||
Reference in new issue
Block a user