From 3ee715939b43fa66ba5c405f8fcea449fb95601b Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Mon, 13 Apr 2026 13:21:46 +0300 Subject: [PATCH] test(form-compile): regression tests for new --from-object types 8 test cases covering InformationRegister (Record periodic/nonperiodic, List), AccumulationRegister (List), ChartOfCharacteristicTypes (Item), ExchangePlan (Item), ChartOfAccounts (Item, List). All 12 tests pass on both PS1 and Python runtimes with form-validate. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../accumreg-list-simple.json | 29 ++++++++++++++++++ .../ccoct-item-simple.json | 21 +++++++++++++ .../chartofaccounts-item-simple.json | 30 +++++++++++++++++++ .../chartofaccounts-list-simple.json | 30 +++++++++++++++++++ .../exchangeplan-item-simple.json | 25 ++++++++++++++++ .../inforeg-list-periodic.json | 28 +++++++++++++++++ .../inforeg-record-nonperiodic.json | 30 +++++++++++++++++++ .../inforeg-record-periodic.json | 29 ++++++++++++++++++ 8 files changed, 222 insertions(+) create mode 100644 tests/skills/cases/form-compile-from-object/accumreg-list-simple.json create mode 100644 tests/skills/cases/form-compile-from-object/ccoct-item-simple.json create mode 100644 tests/skills/cases/form-compile-from-object/chartofaccounts-item-simple.json create mode 100644 tests/skills/cases/form-compile-from-object/chartofaccounts-list-simple.json create mode 100644 tests/skills/cases/form-compile-from-object/exchangeplan-item-simple.json create mode 100644 tests/skills/cases/form-compile-from-object/inforeg-list-periodic.json create mode 100644 tests/skills/cases/form-compile-from-object/inforeg-record-nonperiodic.json create mode 100644 tests/skills/cases/form-compile-from-object/inforeg-record-periodic.json diff --git a/tests/skills/cases/form-compile-from-object/accumreg-list-simple.json b/tests/skills/cases/form-compile-from-object/accumreg-list-simple.json new file mode 100644 index 00000000..4e86dac6 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/accumreg-list-simple.json @@ -0,0 +1,29 @@ +{ + "name": "AccumulationRegister List — Balances, 2 измерения + 3 ресурса", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "AccumulationRegister", + "name": "ДенежныеСредства", + "registerType": "Balances", + "dimensions": [ + { "name": "Организация", "type": "String", "length": 50 }, + { "name": "БанковскийСчет", "type": "String", "length": 34 } + ], + "resources": [ + { "name": "Сумма", "type": "Number", "length": 15, "precision": 2 }, + { "name": "СуммаВалютная", "type": "Number", "length": 15, "precision": 2 }, + { "name": "СуммаУпр", "type": "Number", "length": 15, "precision": 2 } + ] + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "form-add/scripts/form-add", + "args": { "-ObjectPath": "{workDir}/AccumulationRegisters/ДенежныеСредства.xml", "-FormName": "ФормаСписка" } + } + ], + "params": { "outputPath": "AccumulationRegisters/ДенежныеСредства/Forms/ФормаСписка/Ext/Form.xml" }, + "validatePath": "AccumulationRegisters/ДенежныеСредства/Forms/ФормаСписка/Ext/Form.xml" +} diff --git a/tests/skills/cases/form-compile-from-object/ccoct-item-simple.json b/tests/skills/cases/form-compile-from-object/ccoct-item-simple.json new file mode 100644 index 00000000..dc985561 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/ccoct-item-simple.json @@ -0,0 +1,21 @@ +{ + "name": "ChartOfCharacteristicTypes Item — простой ПВХ (код + наименование)", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "ChartOfCharacteristicTypes", + "name": "ВидыНоменклатуры", + "codeLength": 9, + "descriptionLength": 100 + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "form-add/scripts/form-add", + "args": { "-ObjectPath": "{workDir}/ChartsOfCharacteristicTypes/ВидыНоменклатуры.xml", "-FormName": "ФормаЭлемента" } + } + ], + "params": { "outputPath": "ChartsOfCharacteristicTypes/ВидыНоменклатуры/Forms/ФормаЭлемента/Ext/Form.xml" }, + "validatePath": "ChartsOfCharacteristicTypes/ВидыНоменклатуры/Forms/ФормаЭлемента/Ext/Form.xml" +} diff --git a/tests/skills/cases/form-compile-from-object/chartofaccounts-item-simple.json b/tests/skills/cases/form-compile-from-object/chartofaccounts-item-simple.json new file mode 100644 index 00000000..dbe8b7b8 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/chartofaccounts-item-simple.json @@ -0,0 +1,30 @@ +{ + "name": "ChartOfAccounts Item — план счетов с флагами и субконто", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "ChartOfAccounts", + "name": "Хозрасчетный", + "codeLength": 9, + "descriptionLength": 100, + "maxExtDimensionCount": 3, + "accountingFlags": [ + { "name": "Валютный" }, + { "name": "Количественный" } + ], + "extDimensionAccountingFlags": [ + { "name": "Валютный" }, + { "name": "Количественный" } + ] + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "form-add/scripts/form-add", + "args": { "-ObjectPath": "{workDir}/ChartsOfAccounts/Хозрасчетный.xml", "-FormName": "ФормаСчета" } + } + ], + "params": { "outputPath": "ChartsOfAccounts/Хозрасчетный/Forms/ФормаСчета/Ext/Form.xml" }, + "validatePath": "ChartsOfAccounts/Хозрасчетный/Forms/ФормаСчета/Ext/Form.xml" +} diff --git a/tests/skills/cases/form-compile-from-object/chartofaccounts-list-simple.json b/tests/skills/cases/form-compile-from-object/chartofaccounts-list-simple.json new file mode 100644 index 00000000..3aec24bb --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/chartofaccounts-list-simple.json @@ -0,0 +1,30 @@ +{ + "name": "ChartOfAccounts List — план счетов, форма списка", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "ChartOfAccounts", + "name": "Хозрасчетный", + "codeLength": 9, + "descriptionLength": 100, + "maxExtDimensionCount": 3, + "accountingFlags": [ + { "name": "Валютный" }, + { "name": "Количественный" } + ], + "extDimensionAccountingFlags": [ + { "name": "Валютный" }, + { "name": "Количественный" } + ] + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "form-add/scripts/form-add", + "args": { "-ObjectPath": "{workDir}/ChartsOfAccounts/Хозрасчетный.xml", "-FormName": "ФормаСписка" } + } + ], + "params": { "outputPath": "ChartsOfAccounts/Хозрасчетный/Forms/ФормаСписка/Ext/Form.xml" }, + "validatePath": "ChartsOfAccounts/Хозрасчетный/Forms/ФормаСписка/Ext/Form.xml" +} diff --git a/tests/skills/cases/form-compile-from-object/exchangeplan-item-simple.json b/tests/skills/cases/form-compile-from-object/exchangeplan-item-simple.json new file mode 100644 index 00000000..559468c7 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/exchangeplan-item-simple.json @@ -0,0 +1,25 @@ +{ + "name": "ExchangePlan Item — простой план обмена с 2 реквизитами", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "ExchangePlan", + "name": "ОбменДанными", + "codeLength": 9, + "descriptionLength": 100, + "attributes": [ + { "name": "АдресОбмена", "type": "String", "length": 200 }, + { "name": "ДатаПоследнегоОбмена", "type": "Date" } + ] + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "form-add/scripts/form-add", + "args": { "-ObjectPath": "{workDir}/ExchangePlans/ОбменДанными.xml", "-FormName": "ФормаЭлемента" } + } + ], + "params": { "outputPath": "ExchangePlans/ОбменДанными/Forms/ФормаЭлемента/Ext/Form.xml" }, + "validatePath": "ExchangePlans/ОбменДанными/Forms/ФормаЭлемента/Ext/Form.xml" +} diff --git a/tests/skills/cases/form-compile-from-object/inforeg-list-periodic.json b/tests/skills/cases/form-compile-from-object/inforeg-list-periodic.json new file mode 100644 index 00000000..b4d69093 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/inforeg-list-periodic.json @@ -0,0 +1,28 @@ +{ + "name": "InformationRegister List — периодический (Day), RecorderSubordinate, 2 измерения + 1 ресурс", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "InformationRegister", + "name": "ЦеныНоменклатуры", + "periodicity": "Day", + "writeMode": "RecorderSubordinate", + "dimensions": [ + { "name": "Номенклатура", "type": "String", "length": 50 }, + { "name": "ВидЦены", "type": "String", "length": 25 } + ], + "resources": [ + { "name": "Цена", "type": "Number", "length": 15, "precision": 2 } + ] + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "form-add/scripts/form-add", + "args": { "-ObjectPath": "{workDir}/InformationRegisters/ЦеныНоменклатуры.xml", "-FormName": "ФормаСписка" } + } + ], + "params": { "outputPath": "InformationRegisters/ЦеныНоменклатуры/Forms/ФормаСписка/Ext/Form.xml" }, + "validatePath": "InformationRegisters/ЦеныНоменклатуры/Forms/ФормаСписка/Ext/Form.xml" +} diff --git a/tests/skills/cases/form-compile-from-object/inforeg-record-nonperiodic.json b/tests/skills/cases/form-compile-from-object/inforeg-record-nonperiodic.json new file mode 100644 index 00000000..6841cd20 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/inforeg-record-nonperiodic.json @@ -0,0 +1,30 @@ +{ + "name": "InformationRegister Record — непериодический, Independent, 1 измерение + 1 ресурс + 1 реквизит", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "InformationRegister", + "name": "АдресаМагазинов", + "periodicity": "Nonperiodical", + "writeMode": "Independent", + "dimensions": [ + { "name": "Магазин", "type": "String", "length": 50 } + ], + "resources": [ + { "name": "Адрес", "type": "String", "length": 200 } + ], + "attributes": [ + { "name": "Комментарий", "type": "String", "length": 500 } + ] + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "form-add/scripts/form-add", + "args": { "-ObjectPath": "{workDir}/InformationRegisters/АдресаМагазинов.xml", "-FormName": "ФормаЗаписи" } + } + ], + "params": { "outputPath": "InformationRegisters/АдресаМагазинов/Forms/ФормаЗаписи/Ext/Form.xml" }, + "validatePath": "InformationRegisters/АдресаМагазинов/Forms/ФормаЗаписи/Ext/Form.xml" +} diff --git a/tests/skills/cases/form-compile-from-object/inforeg-record-periodic.json b/tests/skills/cases/form-compile-from-object/inforeg-record-periodic.json new file mode 100644 index 00000000..dc19c275 --- /dev/null +++ b/tests/skills/cases/form-compile-from-object/inforeg-record-periodic.json @@ -0,0 +1,29 @@ +{ + "name": "InformationRegister Record — периодический (Day), Independent, 2 измерения + 2 ресурса", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "InformationRegister", + "name": "КурсыВалют", + "periodicity": "Day", + "writeMode": "Independent", + "dimensions": [ + { "name": "Валюта", "type": "String", "length": 10 }, + { "name": "Организация", "type": "String", "length": 50 } + ], + "resources": [ + { "name": "Курс", "type": "Number", "length": 15, "precision": 4 }, + { "name": "Кратность", "type": "Number", "length": 10 } + ] + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "form-add/scripts/form-add", + "args": { "-ObjectPath": "{workDir}/InformationRegisters/КурсыВалют.xml", "-FormName": "ФормаЗаписи" } + } + ], + "params": { "outputPath": "InformationRegisters/КурсыВалют/Forms/ФормаЗаписи/Ext/Form.xml" }, + "validatePath": "InformationRegisters/КурсыВалют/Forms/ФормаЗаписи/Ext/Form.xml" +}