yini-parser
Version:
Readable configuration without YAML foot-guns or JSON noise. The official Node.js parser for YINI config format — An INI-inspired configuration format with clear nesting, explicit types, and predictable parsing.
106 lines (94 loc) • 2.76 kB
JavaScript
"use strict";
// src/dev/quick-test-samples/defect-inputs.ts
Object.defineProperty(exports, "__esModule", { value: true });
exports.defectConfig2Combo3 = exports.defectConfigCombo3 = exports.defectUnterminatedString = exports.defectSectionLevelJump = exports.defectDuplicateKey = exports.defectInvalidNumericLiteral = exports.defectInvalidSectionName = exports.defectInvalidAssignmentOperator = void 0;
/**
* Development-only YINI samples with intentional defects.
*
* These inputs are used for quick manual testing during development
* via src/dev/.
*
* Each sample contains ONE clearly documented defect.
* They are NOT part of the automated test suite.
*
* All real testing belongs in /tests/.
*/
/**
* Invalid assignment operator (`:=` instead of `=`).
*/
exports.defectInvalidAssignmentOperator = `
^ App
name = 'Hello'
txt := 'World' // INVALID: assignment operator must be "="
`;
/**
* Invalid section name (starts with a number and contains hyphen).
*/
exports.defectInvalidSectionName = `
^ App
name = "My Application"
^ 20-Database // INVALID: section name must start with a letter or underscore
host = "localhost"
port = 5432
`;
/**
* Invalid numeric literal (double underscore).
*/
exports.defectInvalidNumericLiteral = `
^ App
name = "Demo"
^ Database
host = "localhost"
port = 5432
someKey = 33__33 // INVALID: malformed numeric literal
`;
/**
* Duplicate key in the same section.
*/
exports.defectDuplicateKey = `
^ App
name = "Demo"
name = "Override" // INVALID: duplicate key in same section
`;
/**
* Section level jump (^^ without parent ^).
*/
exports.defectSectionLevelJump = `
^^ Logging // INVALID: section level jumps without parent
enabled = true
`;
/**
* Unterminated string literal.
*/
exports.defectUnterminatedString = `
^ App
name = "Demo
version = "1.0.0"
`;
exports.defectConfigCombo3 = `
^ App
name = "Combo defects sample"
mode := "dev" // INVALID #1: ':=' is not a valid assignment operator (must be '=')
^ 2Database // INVALID #2: section name starts with a digit (must start with A-Z/_ or be backticked)
host = "localhost"
ports = [80, 443, 8080 // INVALID #3: missing closing ']' in array literal
`;
exports.defectConfig2Combo3 = `
^ App
name = "ComboTest"
version = 1.0
^^ Database
host = "localhost"
port = 54_32 // INVALID number format: underscores not allowed inside numbers
auth = { user: "admin", pass: "secret" }
^^^ Logging
enabled = maybe // INVALID boolean: only true/false/on/off/yes/no allowed
^ Network
timeout = 30
^ Server
host = "0.0.0.0"
port := 8080 // INVALID assignment operator: must use "=" not ":="
^^ Security
useTLS = true
`;
//# sourceMappingURL=defect-inputs.js.map