@@ -140,8 +140,8 @@ public void testRenameClause_unknownVariable() {
140140
141141 assertThatThrownBy (() -> engine .eval ("ds := ds1[rename missing to foo];" ))
142142 .isInstanceOf (VtlScriptException .class )
143- .is (atPosition (0 , 47 , 58 ))
144- .hasMessageContaining ( "Error: source column to rename not found: 'missing '" );
143+ .is (atPosition (0 , 17 , 24 ))
144+ .hasMessage ( "undefined variable 'missing' in 'ds1 '" );
145145 }
146146
147147 @ Test
@@ -159,8 +159,7 @@ public void testRenameClause_duplicateToNamesShouldFail() {
159159
160160 assertThatThrownBy (() -> engine .eval ("ds := ds1[rename age to dup, weight to dup];" ))
161161 .isInstanceOf (VtlScriptException .class )
162- .is (atPosition (0 , 47 , 58 ))
163- .hasMessageContaining ("Error: source column to rename not found: 'missing'" );
162+ .hasMessage ("'dup', is already defined in 'ds1'" );
164163 }
165164
166165 @ Test
@@ -178,8 +177,8 @@ public void testRenameClause_duplicateFromNamesShouldFail() {
178177
179178 assertThatThrownBy (() -> engine .eval ("ds := ds1[rename age to foo, age to bar];" ))
180179 .isInstanceOf (VtlScriptException .class )
181- .hasMessageContaining ("Error: duplicate source name in RENAME clause: 'age'" )
182- .is (atPosition (0 , 47 , 58 ));
180+ .hasMessageContaining ("duplicate from name 'age'" )
181+ .is (atPosition (0 , 29 , 32 ));
183182 }
184183
185184 @ Test
@@ -198,9 +197,8 @@ public void testRenameClause_duplicateToNameShouldFail() {
198197 assertThatThrownBy (
199198 () -> engine .eval ("ds := ds1[rename age to weight, weight to age, name to age];" ))
200199 .isInstanceOf (VtlScriptException .class )
201- .is (atPosition (0 , 47 , 58 ))
202- .hasMessageContaining (
203- "TODO: Improve: Error: duplicate output column name in RENAME clause: 'name'" );
200+ .hasMessage (
201+ "'age', is already defined in 'ds1'" );
204202 }
205203
206204 /** RENAME: duplicate "from" name inside the clause must raise a detailed script error. */
@@ -218,8 +216,8 @@ public void testRenameClause_duplicateFromNameShouldFail() {
218216
219217 assertThatThrownBy (() -> engine .eval ("ds := ds1[rename age to weight, age to weight2];" ))
220218 .isInstanceOf (VtlScriptException .class )
221- .is (atPosition (0 , 0 , 0 , 0 ))
222- .hasMessage ( "TODO: Improve: duplicate source name in RENAME clause " );
219+ .is (atPosition (0 , 32 , 35 ))
220+ .hasMessageContaining ( " duplicate from name 'age' " );
223221 }
224222
225223 /** RENAME: "from" column must exist in dataset. */
@@ -235,8 +233,8 @@ public void testRenameClause_fromColumnNotFoundShouldFail() {
235233
236234 assertThatThrownBy (() -> engine .eval ("ds := ds1[rename unknown to something];" ))
237235 .isInstanceOf (VtlScriptException .class )
238- .is (atPosition (0 , 0 , 0 , 0 ))
239- .hasMessageContaining ( "TODO: Improve: source column to rename not found: 'unknown '" );
236+ .is (atPosition (0 , 17 , 24 ))
237+ .hasMessage ( "undefined variable 'unknown' in 'ds1 '" );
240238 }
241239
242240 /**
@@ -255,10 +253,8 @@ public void testRenameClause_targetCollidesWithUntouchedShouldFail() {
255253
256254 assertThatThrownBy (() -> engine .eval ("ds := ds1[rename name to age];" ))
257255 .isInstanceOf (VtlScriptException .class )
258- .is (atPosition (0 , 0 , 0 , 0 ))
259- .hasMessageContaining ("target name 'age'" ) // main message
260- .hasMessageContaining ("already exists in dataset and is not being renamed" )
261- .hasMessageContaining ("(role=MEASURE, type=class java.lang.Long)" );
256+ .is (atPosition (0 , 25 , 28 ))
257+ .hasMessage ("'age', is already defined in 'ds1'" );
262258 }
263259
264260 @ Test
0 commit comments