Files
marqdo-std-data/scripts/test-strict.sh
T
cflmy 3c14251c28
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
feat: add explicit strict JSON entry point
Implement marqdo-std-data#13 without changing the default `json.解析`
behavior:

- `json.严格解析(文本)` rejects duplicate keys in one object level after
  decoding (`"\u0061"` equals `"a"`) with `json.duplicate_key`, and numbers that
  cannot be represented as finite binary64 values with
  `json.non_finite_number` (1e400 / -1e400 / 1.8e308 reject; 1e308 / 1.79e308
  stay finite).
- The strict validator reuses the existing tokenizer/parser helpers and the
  128-level depth limit; no second JSON grammar or parser is introduced.
- Candidate-input self-test: `tests/json-strict.mq.md` +
  `tests/cases-strict/json-strict.json` + `scripts/test-strict.sh`, kept
  separate from the default suite because the frozen ecosystem Bundle predates
  the new function. `run_cases.py` accepts `MARQDO_STDLIB_CASES_DIR`.
- README documents the new entry, error codes and candidate-Bundle test lane;
  docs/evidence records the real CLI runs and digests.

No cross-repo dependency, no CLI change, no release.
2026-11-30 12:18:07 +08:00

16 lines
839 B
Bash
Executable File

#!/bin/sh
# Candidate-input strict-mode self-test.
#
# Strict JSON rejects duplicate keys and non-finite numbers. Those symbols only
# exist in a Bundle that contains this component's current modules, so this
# suite is separate from the default `scripts/test.sh` (which must keep running
# against the frozen ecosystem Bundle). Callers pass an explicit candidate
# Bundle produced from the current component gitlink, e.g. by the root repo's
# `scripts/build-stdlib.py` / acceptance pipeline.
set -eu
: "${MARQDO_BIN:?set MARQDO_BIN to the verified marqdo executable}"
: "${MARQDO_STDLIB_DIR:?set MARQDO_STDLIB_DIR to a candidate Bundle containing current modules}"
MARQDO_STDLIB_CASES_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/../tests/cases-strict" && pwd)"
export MARQDO_STDLIB_CASES_DIR
exec python3 "$(dirname "$0")/run_cases.py" "$@"