archivetest

package
v0.60.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package archivetest builds hostile archives for tests. It imports nothing from filex, so the archive reader's own tests can use it too.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LyingZip

func LyingZip(t *testing.T, size int) []byte

LyingZip builds a ZIP of one deflated member, payload.bin, holding size zero bytes while its local and central headers both say it holds 100: the shape of a decompression bomb that lies about its size. Readers that trust the declared size must stop at 100 bytes.

func RawNameZip added in v0.60.0

func RawNameZip(t *testing.T, members ...RawMember) []byte

RawNameZip builds a ZIP whose members carry their names as raw bytes with the UTF-8 flag (general purpose bit 11) CLEAR - the shape of an archive Windows' "Compressed folder" writes in the machine's DOS code page (IBM 857 on a Turkish Windows, 437 by the ZIP specification).

Types

type RawMember added in v0.60.0

type RawMember struct {
	Name string
	Body string
}

RawMember is one member of RawNameZip: its name as raw BYTES, and its body.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL