mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-18 16:49:41 +03:00
test(support-guard): committed deny-тесты на 13 навыков-мутаторов + фикс help-add
Регрессионная защита гарда: по одному expectError-кейсу guard-deny на каждый из 13 размноженных мутаторов (раньше committed-тесты были только у 3 пилотных). Ловит случайное удаление/поломку guard-вызова в будущем. Фикстуры on-support (рукотворный bin: корень/объект f1=0, плюс элемент f1=0 для edit-existing навыков — форма 4444, макет 5555, подсистема 6666). Структура под конвенцию каждого навбыка: owner/root для add/compile/edit конфигурации; плоский Locked/Ext для help-add (EPF-стиль). Заодно исправлен пред-существующий баг help-add Detect-FormatVersion (v1.5→v1.6, оба порта): Substring(0, byteLength) падал на кириллическом Configuration.xml (байт>символов). Теперь Substring по длине строки; фикстура help-add кириллическая — регрессия фикса покрыта тестом. Все 13 guard-кейсов зелёные на PowerShell и Python; deny через exit≠0 + stderr "support-guard". Существующие кейсы не затронуты. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# help-add v1.5 — Add built-in help to 1C object
|
||||
# help-add v1.6 — Add built-in help to 1C object
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
@@ -126,7 +126,8 @@ function Detect-FormatVersion([string]$dir) {
|
||||
while ($d) {
|
||||
$cfgPath = Join-Path $d "Configuration.xml"
|
||||
if (Test-Path $cfgPath) {
|
||||
$head = [System.IO.File]::ReadAllText($cfgPath, [System.Text.Encoding]::UTF8).Substring(0, [Math]::Min(2000, (Get-Item $cfgPath).Length))
|
||||
$content = [System.IO.File]::ReadAllText($cfgPath, [System.Text.Encoding]::UTF8)
|
||||
$head = $content.Substring(0, [Math]::Min(2000, $content.Length))
|
||||
if ($head -match '<MetaDataObject[^>]+version="(\d+\.\d+)"') { return $Matches[1] }
|
||||
}
|
||||
$parent = Split-Path $d -Parent
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# add-help v1.5 — Add built-in help to 1C object
|
||||
# add-help v1.6 — Add built-in help to 1C object
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import argparse
|
||||
|
||||
Reference in New Issue
Block a user