feat: add meta-validate, meta-info tests and broken fixtures

- meta-validate: 3 cases (valid catalog, bad root element, file not found)
- meta-info: 2 cases (catalog overview with stdoutContains, not found error)
- fixtures/broken/catalog-bad-root for negative validate tests
- All 5 skill archetypes now covered: compile, init, edit, validate, info

17 tests, all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-28 13:08:53 +03:00
parent 95776a4248
commit 312d058412
8 changed files with 77 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
{
"script": "meta-info/scripts/meta-info",
"setup": "none",
"args": [
{ "flag": "-ObjectPath", "from": "workPath", "field": "objectPath" }
],
"snapshot": {
"root": "workDir",
"normalizeUuids": false
}
}
@@ -0,0 +1,22 @@
{
"name": "Обзор справочника с реквизитами",
"setup": "empty-config",
"preRun": [
{
"script": "meta-compile/scripts/meta-compile",
"input": {
"type": "Catalog",
"name": "Номенклатура",
"attributes": [
{ "name": "Артикул", "type": "String", "length": 25 },
{ "name": "Цена", "type": "Number", "length": 15, "precision": 2 }
]
},
"args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" }
}
],
"params": { "objectPath": "Catalogs/Номенклатура" },
"expect": {
"stdoutContains": "Номенклатура"
}
}
@@ -0,0 +1,5 @@
{
"name": "Ошибка: объект не найден",
"params": { "objectPath": "Catalogs/НесуществующийОбъект" },
"expectError": true
}
@@ -0,0 +1,11 @@
{
"script": "meta-validate/scripts/meta-validate",
"setup": "none",
"args": [
{ "flag": "-ObjectPath", "from": "workPath", "field": "objectPath" }
],
"snapshot": {
"root": "workDir",
"normalizeUuids": false
}
}
@@ -0,0 +1,6 @@
{
"name": "Валидатор находит ошибку: неверный корневой элемент",
"setup": "fixture:broken/catalog-bad-root",
"params": { "objectPath": "Catalogs/Bad.xml" },
"expectError": true
}
@@ -0,0 +1,5 @@
{
"name": "Валидатор: файл не найден",
"params": { "objectPath": "Catalogs/Несуществующий.xml" },
"expectError": true
}
@@ -0,0 +1,12 @@
{
"name": "Корректный справочник проходит валидацию",
"setup": "empty-config",
"preRun": [
{
"script": "meta-compile/scripts/meta-compile",
"input": { "type": "Catalog", "name": "Тест" },
"args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" }
}
],
"params": { "objectPath": "Catalogs/Тест" }
}
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<WrongRoot xmlns="http://v8.1c.ru/8.3/MDClasses">
<Catalog uuid="00000000-0000-0000-0000-000000000001">
</Catalog>
</WrongRoot>