@@ -261,12 +261,12 @@ impl Scope {
261261mod test {
262262 use super :: * ;
263263 use crate :: document:: Document ;
264- use crate :: { ToSourceKind , single} ;
264+ use crate :: { ToSourceKind , Variables , single} ;
265265
266266 #[ test]
267267 fn eval_node ( ) {
268268 let mut doc = Document :: new ( "node" ) ;
269- let ( bp , _ ) = doc. compile ( ) . unwrap ( ) ;
269+ let bp = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
270270 assert_eq ! ( bp, single!( "node" ) ) ;
271271 }
272272
@@ -277,7 +277,7 @@ mod test {
277277 b
278278 " ;
279279 let mut doc = Document :: new ( src) ;
280- let ( blueprint, _ ) = doc. compile ( ) . unwrap ( ) ;
280+ let blueprint = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
281281 assert_eq ! ( blueprint, single!( children @ "a" , vec![ single!( "b" ) ] ) ) ;
282282 }
283283
@@ -289,7 +289,7 @@ mod test {
289289 " ;
290290
291291 let mut doc = Document :: new ( src) ;
292- let ( blueprint, _ ) = doc. compile ( ) . unwrap ( ) ;
292+ let blueprint = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
293293 assert ! ( matches!( blueprint, Blueprint :: Single ( Single { value: Some ( _) , .. } ) ) ) ;
294294 }
295295
@@ -298,7 +298,7 @@ mod test {
298298 let src = "let state = 1" ;
299299
300300 let mut doc = Document :: new ( src) ;
301- let response = doc. compile ( ) ;
301+ let response = doc. compile ( & mut Variables :: new ( ) ) ;
302302 assert_eq ! (
303303 response. err( ) . unwrap( ) . to_string( ) ,
304304 "invalid statement: state is a reserved identifier"
@@ -313,7 +313,7 @@ mod test {
313313 " ;
314314
315315 let mut doc = Document :: new ( src) ;
316- let response = doc. compile ( ) ;
316+ let response = doc. compile ( & mut Variables :: new ( ) ) ;
317317 assert_eq ! (
318318 response. err( ) . unwrap( ) . to_string( ) ,
319319 "invalid statement: state is a reserved identifier"
@@ -327,7 +327,7 @@ mod test {
327327 node
328328 " ;
329329 let mut doc = Document :: new ( src) ;
330- let ( blueprint, _ ) = doc. compile ( ) . unwrap ( ) ;
330+ let blueprint = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
331331 assert ! ( matches!( blueprint, Blueprint :: For ( For { .. } ) ) ) ;
332332 }
333333
@@ -341,7 +341,7 @@ mod test {
341341 " ;
342342
343343 let mut doc = Document :: new ( src) ;
344- let ( blueprint, _ ) = doc. compile ( ) . unwrap ( ) ;
344+ let blueprint = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
345345 let Blueprint :: ControlFlow ( controlflow) = blueprint else { panic ! ( ) } ;
346346 assert ! ( matches!( controlflow. elses[ 0 ] , Else { .. } ) ) ;
347347 assert ! ( !controlflow. elses. is_empty( ) ) ;
@@ -356,7 +356,7 @@ mod test {
356356 " ;
357357
358358 let mut doc = Document :: new ( src) ;
359- let ( blueprint, _ ) = doc. compile ( ) . unwrap ( ) ;
359+ let blueprint = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
360360 let Blueprint :: ControlFlow ( controlflow) = blueprint else { panic ! ( ) } ;
361361 assert ! ( matches!( controlflow. elses[ 0 ] , Else { .. } ) ) ;
362362 assert ! ( !controlflow. elses. is_empty( ) ) ;
@@ -374,7 +374,7 @@ mod test {
374374 " ;
375375
376376 let mut doc = Document :: new ( src) ;
377- let ( blueprint, _ ) = doc. compile ( ) . unwrap ( ) ;
377+ let blueprint = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
378378 let Blueprint :: ControlFlow ( controlflow) = blueprint else { panic ! ( ) } ;
379379 assert ! ( matches!( controlflow. elses[ 0 ] , Else { .. } ) ) ;
380380 assert ! ( !controlflow. elses. is_empty( ) ) ;
@@ -387,7 +387,7 @@ mod test {
387387
388388 let mut doc = Document :: new ( src) ;
389389 doc. add_component ( "comp" , comp_src. to_template ( ) ) . unwrap ( ) ;
390- let ( blueprint, _ ) = doc. compile ( ) . unwrap ( ) ;
390+ let blueprint = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
391391 assert ! ( matches!( blueprint, Blueprint :: Component ( Component { .. } ) ) ) ;
392392 }
393393
@@ -412,7 +412,7 @@ mod test {
412412
413413 let mut doc = Document :: new ( src) ;
414414 doc. add_component ( "comp" , comp_src. to_template ( ) ) . unwrap ( ) ;
415- let ( blueprint, _ ) = doc. compile ( ) . unwrap ( ) ;
415+ let blueprint = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
416416 assert ! ( matches!( blueprint, Blueprint :: Component ( Component { .. } ) ) ) ;
417417 }
418418
@@ -426,7 +426,7 @@ mod test {
426426
427427 let mut doc = Document :: new ( src) ;
428428 doc. add_component ( "comp" , "node a" . to_template ( ) ) . unwrap ( ) ;
429- let _ = doc. compile ( ) . unwrap ( ) ;
429+ let _ = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
430430 }
431431
432432 #[ test]
@@ -437,7 +437,7 @@ mod test {
437437
438438 let mut doc = Document :: new ( src) ;
439439 doc. add_component ( "comp" , "node a" . to_template ( ) ) . unwrap ( ) ;
440- let _ = doc. compile ( ) . unwrap ( ) ;
440+ let _ = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
441441 }
442442
443443 #[ test]
@@ -449,7 +449,7 @@ mod test {
449449
450450 let mut doc = Document :: new ( src) ;
451451 doc. add_component ( "comp" , "node a" . to_template ( ) ) . unwrap ( ) ;
452- let ( blueprint, _ ) = doc. compile ( ) . unwrap ( ) ;
452+ let blueprint = doc. compile ( & mut Variables :: new ( ) ) . unwrap ( ) ;
453453 assert ! ( matches!( blueprint, Blueprint :: With ( With { .. } ) ) ) ;
454454 }
455455}
0 commit comments