Documentation
¶
Overview ¶
Package hostilenames is the one list of hostile file names every surface of filex is tested with: Turkish and CJK letters, right-to-left scripts, emoji, the same name composed and decomposed, spaces and dots at the ends, URL and shell metacharacters, Windows device names and forbidden characters, names at and over the 255-byte limit, invisible and bidi control characters, case twins (task #238).
The list is names.json beside this file. The e2e specs, the web unit tests and the desktop scripts read the same file through ONE small JavaScript reader (e2e/helpers/hostile-names.mjs), so a name added there reaches every surface. ⚠ Never copy a name into a second list: add it to names.json.
Like archivetest it imports nothing from filex, so any package's internal tests can use it without an import cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Name ¶
type Name struct {
// ID is stable and safe in a test name or a log line ("rlo-extension").
ID string
// Name is the name itself, invisible characters and all.
Name string
// Why says in a few words what the name breaks.
Why string
// Tags group the names: unicode, cjk, rtl, emoji, nfd, space, dots, url,
// html, quote, separator, win-reserved, win-forbidden, long,
// over-255-bytes, invisible, bidi-control, control, case.
Tags []string
// Refused: no filex surface may create a file with this name.
Refused bool
// WindowsInvalid: the name cannot exist as a file name on Windows (a
// device name, a forbidden character, a trailing space or dot).
WindowsInvalid bool
// Twin is the ID of the name that is the same name to a case- or
// normalisation-insensitive file system, TwinKind why.
Twin string
TwinKind TwinKind
}
Name is one hostile name.
func All ¶
func All() []Name
All is every hostile name, in the file's order. The slice is the caller's.
func Creatable ¶
func Creatable() []Name
Creatable is every name a filex surface must accept (not Refused).
func ForLocalDisk ¶
func ForLocalDisk() []Name
ForLocalDisk is every Creatable name the test machine's own file system can hold side by side in ONE folder - what a test writes through a local-disk storage, which keeps the name it is given:
- no name over 255 bytes, except on Windows, whose limit is 255 UTF-16 units (TooLongForLocalDisk has them, for the refusal);
- on Windows, no name Windows refuses (WindowsInvalid);
- on Windows and macOS, whose file systems are case-insensitive (and on macOS normalisation-insensitive), only the first name of each twin pair: the second would land on the first.
The suite runs on Linux, where every name but those over 255 bytes is kept; the filter is what lets the same test pass on a developer's laptop.
func TooLongForLocalDisk ¶
func TooLongForLocalDisk() []Name
TooLongForLocalDisk is every Creatable name the test machine's file system refuses for its length: over 255 bytes on Linux and macOS (ENAMETOOLONG). Empty on Windows, which counts UTF-16 units and holds them all.