test(meta-edit): исправить формат кейсов на документированный JSON DSL

9 кейсов задавали правки через `{operations:[{op,...}]}` — такого формата
meta-edit не понимает (ключ не в add/remove/modify), поэтому операции молча
пропускались (Warn «Unknown operation»), и снэпшоты фиксировали лишь исходный
скомпилированный объект. Тесты фактически ничего не проверяли.

Переписаны на формат из json-dsl.md: add/remove/modify → attributes/
enumValues/tabularSections/properties (shorthand-строки). Снэпшоты
переснятые — теперь реально содержат эффекты (ИНН добавлен, Устаревший
удалён, Телефон→НомерТелефона, CodeLength=11, ТЧ с реквизитами, Цена в ТЧ).
Регресс 11/11 ps1+py.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-07-03 19:37:46 +03:00
parent d007da5eb8
commit 5a9b111dc0
17 changed files with 283 additions and 94 deletions
@@ -9,8 +9,6 @@
],
"params": { "objectPath": "Catalogs/Контрагенты" },
"input": {
"operations": [
{ "op": "add-attribute", "name": "ИНН", "type": "String", "length": 12 }
]
"add": { "attributes": ["ИНН: String(12)"] }
}
}
@@ -9,9 +9,6 @@
],
"params": { "objectPath": "Enums/Статусы" },
"input": {
"operations": [
{ "op": "add-enumValue", "name": "ВРаботе" },
{ "op": "add-enumValue", "name": "Закрыт" }
]
"add": { "enumValues": ["ВРаботе", "Закрыт"] }
}
}
+5 -10
View File
@@ -9,15 +9,10 @@
],
"params": { "objectPath": "Catalogs/Контрагенты" },
"input": {
"operations": [
{
"op": "add-ts",
"name": "КонтактнаяИнформация",
"attributes": [
{ "name": "Тип", "type": "String", "length": 50 },
{ "name": "Значение", "type": "String", "length": 250 }
]
}
]
"add": {
"tabularSections": [
{ "name": "КонтактнаяИнформация", "attrs": ["Тип: String(50)", "Значение: String(250)"] }
]
}
}
}
@@ -13,8 +13,10 @@
],
"params": { "objectPath": "Documents/Заказ" },
"input": {
"operations": [
{ "op": "add-ts-attribute", "ts": "Товары", "name": "Цена", "type": "Number", "length": 15, "precision": 2 }
]
"modify": {
"tabularSections": {
"Товары": { "add": ["Цена: Number(15,2)"] }
}
}
}
}
@@ -13,9 +13,7 @@
],
"params": { "objectPath": "Catalogs/Товары" },
"input": {
"operations": [
{ "op": "add-attribute", "name": "Производитель", "type": "String", "length": 100 },
{ "op": "remove-attribute", "name": "Устаревший" }
]
"add": { "attributes": ["Производитель: String(100)"] },
"remove": { "attributes": ["Устаревший"] }
}
}
@@ -2,6 +2,6 @@
"name": "Guard: правка объекта на замке (f1=0) запрещена",
"setup": "fixture:on-support",
"params": { "objectPath": "Catalogs/Locked.xml" },
"input": { "operations": [ { "op": "add-attribute", "name": "ТестРеквизит", "type": "String", "length": 10 } ] },
"input": { "add": { "attributes": ["ТестРеквизит: String(10)"] } },
"expectError": "support-guard"
}
@@ -13,8 +13,10 @@
],
"params": { "objectPath": "Catalogs/Контрагенты" },
"input": {
"operations": [
{ "op": "modify-attribute", "name": "Телефон", "changes": { "name": "НомерТелефона", "type": "String", "length": 50 } }
]
"modify": {
"attributes": {
"Телефон": { "name": "НомерТелефона", "type": "String(50)" }
}
}
}
}
@@ -9,9 +9,6 @@
],
"params": { "objectPath": "Catalogs/Организации" },
"input": {
"operations": [
{ "op": "modify-property", "name": "CodeLength", "value": "11" },
{ "op": "modify-property", "name": "DescriptionLength", "value": "150" }
]
"modify": { "properties": { "CodeLength": 11, "DescriptionLength": 150 } }
}
}
@@ -13,8 +13,6 @@
],
"params": { "objectPath": "Catalogs/Контрагенты" },
"input": {
"operations": [
{ "op": "remove-attribute", "name": "Устаревший" }
]
"remove": { "attributes": ["Устаревший"] }
}
}
@@ -86,6 +86,51 @@
<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>
<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>
</Properties>
<ChildObjects />
<ChildObjects>
<Attribute uuid="UUID-012">
<Properties>
<Name>ИНН</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Инн</v8:content>
</v8:item>
</Synonym>
<Comment />
<Type>
<v8:Type>xs:string</v8:Type>
<v8:StringQualifiers>
<v8:Length>12</v8:Length>
<v8:AllowedLength>Variable</v8:AllowedLength>
</v8:StringQualifiers>
</Type>
<PasswordMode>false</PasswordMode>
<Format />
<EditFormat />
<ToolTip />
<MarkNegatives>false</MarkNegatives>
<Mask />
<MultiLine>false</MultiLine>
<ExtendedEdit>false</ExtendedEdit>
<MinValue xsi:nil="true" />
<MaxValue xsi:nil="true" />
<FillFromFillingValue>false</FillFromFillingValue>
<FillValue xsi:type="xs:string" />
<FillChecking>DontCheck</FillChecking>
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
<ChoiceParameterLinks />
<ChoiceParameters />
<QuickChoice>Auto</QuickChoice>
<CreateOnInput>Auto</CreateOnInput>
<ChoiceForm />
<LinkByType />
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
<Use>ForItem</Use>
<Indexing>DontIndex</Indexing>
<FullTextSearch>Use</FullTextSearch>
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
</ChildObjects>
</Catalog>
</MetaDataObject>
@@ -104,6 +104,30 @@
<Comment />
</Properties>
</EnumValue>
<EnumValue uuid="UUID-009">
<Properties>
<Name>ВРаботе</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Вработе</v8:content>
</v8:item>
</Synonym>
<Comment />
</Properties>
</EnumValue>
<EnumValue uuid="UUID-010">
<Properties>
<Name>Закрыт</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Закрыт</v8:content>
</v8:item>
</Synonym>
<Comment />
</Properties>
</EnumValue>
</ChildObjects>
</Enum>
</MetaDataObject>
@@ -86,6 +86,144 @@
<UpdateDataHistoryImmediatelyAfterWrite>false</UpdateDataHistoryImmediatelyAfterWrite>
<ExecuteAfterWriteDataHistoryVersionProcessing>false</ExecuteAfterWriteDataHistoryVersionProcessing>
</Properties>
<ChildObjects />
<ChildObjects>
<TabularSection uuid="UUID-012">
<InternalInfo>
<xr:GeneratedType name="CatalogTabularSection.Контрагенты.КонтактнаяИнформация" category="TabularSection">
<xr:TypeId>UUID-013</xr:TypeId>
<xr:ValueId>UUID-014</xr:ValueId>
</xr:GeneratedType>
<xr:GeneratedType name="CatalogTabularSectionRow.Контрагенты.КонтактнаяИнформация" category="TabularSectionRow">
<xr:TypeId>UUID-015</xr:TypeId>
<xr:ValueId>UUID-016</xr:ValueId>
</xr:GeneratedType>
</InternalInfo>
<Properties>
<Name>КонтактнаяИнформация</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Контактная информация</v8:content>
</v8:item>
</Synonym>
<Comment />
<ToolTip />
<FillChecking>DontCheck</FillChecking>
<StandardAttributes>
<xr:StandardAttribute name="LineNumber">
<xr:LinkByType />
<xr:FillChecking>DontCheck</xr:FillChecking>
<xr:MultiLine>false</xr:MultiLine>
<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
<xr:CreateOnInput>Auto</xr:CreateOnInput>
<xr:MaxValue xsi:nil="true" />
<xr:ToolTip />
<xr:ExtendedEdit>false</xr:ExtendedEdit>
<xr:Format />
<xr:ChoiceForm />
<xr:QuickChoice>Auto</xr:QuickChoice>
<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
<xr:EditFormat />
<xr:PasswordMode>false</xr:PasswordMode>
<xr:DataHistory>Use</xr:DataHistory>
<xr:MarkNegatives>false</xr:MarkNegatives>
<xr:MinValue xsi:nil="true" />
<xr:Synonym />
<xr:Comment />
<xr:FullTextSearch>Use</xr:FullTextSearch>
<xr:ChoiceParameterLinks />
<xr:FillValue xsi:nil="true" />
<xr:Mask />
<xr:ChoiceParameters />
</xr:StandardAttribute>
</StandardAttributes>
<Use>ForItem</Use>
</Properties>
<ChildObjects>
<Attribute uuid="UUID-017">
<Properties>
<Name>Тип</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Тип</v8:content>
</v8:item>
</Synonym>
<Comment />
<Type>
<v8:Type>xs:string</v8:Type>
<v8:StringQualifiers>
<v8:Length>50</v8:Length>
<v8:AllowedLength>Variable</v8:AllowedLength>
</v8:StringQualifiers>
</Type>
<PasswordMode>false</PasswordMode>
<Format />
<EditFormat />
<ToolTip />
<MarkNegatives>false</MarkNegatives>
<Mask />
<MultiLine>false</MultiLine>
<ExtendedEdit>false</ExtendedEdit>
<MinValue xsi:nil="true" />
<MaxValue xsi:nil="true" />
<FillChecking>DontCheck</FillChecking>
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
<ChoiceParameterLinks />
<ChoiceParameters />
<QuickChoice>Auto</QuickChoice>
<CreateOnInput>Auto</CreateOnInput>
<ChoiceForm />
<LinkByType />
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
<Indexing>DontIndex</Indexing>
<FullTextSearch>Use</FullTextSearch>
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-018">
<Properties>
<Name>Значение</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Значение</v8:content>
</v8:item>
</Synonym>
<Comment />
<Type>
<v8:Type>xs:string</v8:Type>
<v8:StringQualifiers>
<v8:Length>250</v8:Length>
<v8:AllowedLength>Variable</v8:AllowedLength>
</v8:StringQualifiers>
</Type>
<PasswordMode>false</PasswordMode>
<Format />
<EditFormat />
<ToolTip />
<MarkNegatives>false</MarkNegatives>
<Mask />
<MultiLine>false</MultiLine>
<ExtendedEdit>false</ExtendedEdit>
<MinValue xsi:nil="true" />
<MaxValue xsi:nil="true" />
<FillChecking>DontCheck</FillChecking>
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
<ChoiceParameterLinks />
<ChoiceParameters />
<QuickChoice>Auto</QuickChoice>
<CreateOnInput>Auto</CreateOnInput>
<ChoiceForm />
<LinkByType />
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
<Indexing>DontIndex</Indexing>
<FullTextSearch>Use</FullTextSearch>
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
</ChildObjects>
</TabularSection>
</ChildObjects>
</Catalog>
</MetaDataObject>
@@ -341,6 +341,48 @@
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-019">
<Properties>
<Name>Цена</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Цена</v8:content>
</v8:item>
</Synonym>
<Comment />
<Type>
<v8:Type>xs:decimal</v8:Type>
<v8:NumberQualifiers>
<v8:Digits>15</v8:Digits>
<v8:FractionDigits>2</v8:FractionDigits>
<v8:AllowedSign>Any</v8:AllowedSign>
</v8:NumberQualifiers>
</Type>
<PasswordMode>false</PasswordMode>
<Format />
<EditFormat />
<ToolTip />
<MarkNegatives>false</MarkNegatives>
<Mask />
<MultiLine>false</MultiLine>
<ExtendedEdit>false</ExtendedEdit>
<MinValue xsi:nil="true" />
<MaxValue xsi:nil="true" />
<FillChecking>DontCheck</FillChecking>
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
<ChoiceParameterLinks />
<ChoiceParameters />
<QuickChoice>Auto</QuickChoice>
<CreateOnInput>Auto</CreateOnInput>
<ChoiceForm />
<LinkByType />
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
<Indexing>DontIndex</Indexing>
<FullTextSearch>Use</FullTextSearch>
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
</ChildObjects>
</TabularSection>
</ChildObjects>
@@ -133,18 +133,18 @@
</Attribute>
<Attribute uuid="UUID-013">
<Properties>
<Name>Устаревший</Name>
<Name>Производитель</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Устаревший</v8:content>
<v8:content>Производитель</v8:content>
</v8:item>
</Synonym>
<Comment />
<Type>
<v8:Type>xs:string</v8:Type>
<v8:StringQualifiers>
<v8:Length>10</v8:Length>
<v8:Length>100</v8:Length>
<v8:AllowedLength>Variable</v8:AllowedLength>
</v8:StringQualifiers>
</Type>
@@ -89,18 +89,16 @@
<ChildObjects>
<Attribute uuid="UUID-012">
<Properties>
<Name>Телефон</Name>
<Synonym>
<Name>НомерТелефона</Name><Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Телефон</v8:content>
<v8:content>Номер телефона</v8:content>
</v8:item>
</Synonym>
<Comment />
<Type>
<Comment /><Type>
<v8:Type>xs:string</v8:Type>
<v8:StringQualifiers>
<v8:Length>20</v8:Length>
<v8:Length>50</v8:Length>
<v8:AllowedLength>Variable</v8:AllowedLength>
</v8:StringQualifiers>
</Type>
@@ -114,8 +112,7 @@
<ExtendedEdit>false</ExtendedEdit>
<MinValue xsi:nil="true" />
<MaxValue xsi:nil="true" />
<FillFromFillingValue>false</FillFromFillingValue>
<FillValue xsi:type="xs:string" />
<FillFromFillingValue>false</FillFromFillingValue><FillValue xsi:type="xs:string" />
<FillChecking>DontCheck</FillChecking>
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
<ChoiceParameterLinks />
@@ -40,8 +40,8 @@
<UseStandardCommands>true</UseStandardCommands>
<Owners />
<SubordinationUse>ToItems</SubordinationUse>
<CodeLength>9</CodeLength>
<DescriptionLength>25</DescriptionLength>
<CodeLength>11</CodeLength>
<DescriptionLength>150</DescriptionLength>
<CodeType>String</CodeType>
<CodeAllowedLength>Variable</CodeAllowedLength>
<CodeSeries>WholeCatalog</CodeSeries>
@@ -131,50 +131,6 @@
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
<Attribute uuid="UUID-013">
<Properties>
<Name>Устаревший</Name>
<Synonym>
<v8:item>
<v8:lang>ru</v8:lang>
<v8:content>Устаревший</v8:content>
</v8:item>
</Synonym>
<Comment />
<Type>
<v8:Type>xs:string</v8:Type>
<v8:StringQualifiers>
<v8:Length>50</v8:Length>
<v8:AllowedLength>Variable</v8:AllowedLength>
</v8:StringQualifiers>
</Type>
<PasswordMode>false</PasswordMode>
<Format />
<EditFormat />
<ToolTip />
<MarkNegatives>false</MarkNegatives>
<Mask />
<MultiLine>false</MultiLine>
<ExtendedEdit>false</ExtendedEdit>
<MinValue xsi:nil="true" />
<MaxValue xsi:nil="true" />
<FillFromFillingValue>false</FillFromFillingValue>
<FillValue xsi:type="xs:string" />
<FillChecking>DontCheck</FillChecking>
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
<ChoiceParameterLinks />
<ChoiceParameters />
<QuickChoice>Auto</QuickChoice>
<CreateOnInput>Auto</CreateOnInput>
<ChoiceForm />
<LinkByType />
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
<Use>ForItem</Use>
<Indexing>DontIndex</Indexing>
<FullTextSearch>Use</FullTextSearch>
<DataHistory>Use</DataHistory>
</Properties>
</Attribute>
</ChildObjects>
</Catalog>
</MetaDataObject>