UniSet 2.45.1
Пространство имен tests.test_transformer_fb

Классы

class  TestFBInstanceDetection
class  TestFBCallTransformation
class  TestFBFieldAccess
class  TestFBCallsFixture
class  TestFunctionBlockDeclaration

Функции

IRProgram _transform_source (str source)
str _load_fixture (str name)

Переменные

 FIXTURES_DIR = os.path.join(os.path.dirname(__file__), "fixtures")

Подробное описание

Tests for function block support in transformer.

Tests cover:
- FB instance detection in VAR declarations (TON, CTU, R_TRIG, RS, etc.)
- FB call statement transformation (FunctionCallStatement -> IRFBCall)
- FB output field access (myTimer.Q -> IRFieldAccess)
- FUNCTION_BLOCK declaration -> IRFunctionBlock
- All 10 standard FB types recognized

Функции

◆ _load_fixture()

str tests.test_transformer_fb._load_fixture ( str name)
protected
Load a test fixture file.

◆ _transform_source()

IRProgram tests.test_transformer_fb._transform_source ( str source)
protected
Helper: parse ST source and transform to IR.