@@ -12,36 +12,42 @@ struct Harness;
1212impl Harness {
1313 #[ track_caller]
1414 fn assert_collections ( o : usize ) {
15- BOA_GC . with ( |current| {
15+ let collections = BOA_GC . with ( |current| {
1616 let gc = current. borrow ( ) ;
17- assert_eq ! ( gc. runtime. collections, o ) ;
17+ gc. runtime . collections
1818 } ) ;
19+
20+ assert_eq ! ( collections, o) ;
1921 }
2022
2123 #[ track_caller]
2224 fn assert_empty_gc ( ) {
23- BOA_GC . with ( |current| {
25+ let ( is_empty , bytes_allocated ) = BOA_GC . with ( |current| {
2426 let gc = current. borrow ( ) ;
25-
26- assert ! ( gc. strongs. is_empty( ) ) ;
27- assert ! ( gc. runtime. bytes_allocated == 0 ) ;
27+ ( gc. strongs . is_empty ( ) , gc. runtime . bytes_allocated )
2828 } ) ;
29+
30+ assert ! ( is_empty) ;
31+ assert_eq ! ( bytes_allocated, 0 ) ;
2932 }
3033
3134 #[ track_caller]
3235 fn assert_bytes_allocated ( ) {
33- BOA_GC . with ( |current| {
36+ let bytes_allocated = BOA_GC . with ( |current| {
3437 let gc = current. borrow ( ) ;
35- assert ! ( gc. runtime. bytes_allocated > 0 ) ;
38+ gc. runtime . bytes_allocated
3639 } ) ;
40+
41+ assert ! ( bytes_allocated > 0 ) ;
3742 }
3843
3944 #[ track_caller]
4045 fn assert_exact_bytes_allocated ( bytes : usize ) {
41- BOA_GC . with ( |current| {
46+ let bytes_allocated = BOA_GC . with ( |current| {
4247 let gc = current. borrow ( ) ;
43- assert_eq ! ( gc. runtime. bytes_allocated, bytes ) ;
48+ gc. runtime . bytes_allocated
4449 } ) ;
50+ assert_eq ! ( bytes_allocated, bytes) ;
4551 }
4652}
4753
0 commit comments