From 27d5ec9355aa0553b1610655ec64a89de3ce8c5e Mon Sep 17 00:00:00 2001 From: fabiovandewaeter Date: Thu, 23 May 2024 15:21:16 +0200 Subject: [PATCH] fix makeActInvocation and makeTestMethod --- src/Famix-UnitTest-Exporter/FamixUTSUnitExporter.class.st | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Famix-UnitTest-Exporter/FamixUTSUnitExporter.class.st b/src/Famix-UnitTest-Exporter/FamixUTSUnitExporter.class.st index f259451..08b27a1 100644 --- a/src/Famix-UnitTest-Exporter/FamixUTSUnitExporter.class.st +++ b/src/Famix-UnitTest-Exporter/FamixUTSUnitExporter.class.st @@ -167,7 +167,7 @@ FamixUTSUnitExporter >> makeActInvocation: aFamixUTAct [ self valueExporter makeVariableExpression: receiver ]) selector: testedMethod name arguments: (aFamixUTAct arguments collect: [ :argument | - self valueExporter makeVariableExpression: argument ]) + self valueExporter makeVariableExpression: argument value ]) ] { #category : #exporting } @@ -207,7 +207,13 @@ FamixUTSUnitExporter >> makeTestCaseReceiver: aFamixUTCase [ { #category : #ast } FamixUTSUnitExporter >> makeTestMethod: aFamixUTMethod [ + "Create missing temporary variables" + statementBlock allChildren do: [ :each | + each isAssignment ifTrue: [ + (statementBlock temporaries anySatisfy: [ :temporary | + temporary name = each variable name ]) ifFalse: [ + statementBlock addTemporaryNamed: each variable name ] ] ]. ^ RBMethodNode selector: aFamixUTMethod name body: statementBlock ]