@@ -1367,7 +1367,7 @@ main() {
1367
1367
1368
1368
group ("if" , () {
1369
1369
test ("await in test" , () {
1370
- f (v) async {
1370
+ f (bool v) async {
1371
1371
if (await new Future .value (v)) {
1372
1372
return 42 ;
1373
1373
} else {
@@ -1379,7 +1379,7 @@ main() {
1379
1379
});
1380
1380
1381
1381
test ("await err in test" , () {
1382
- f (v) async {
1382
+ f (bool v) async {
1383
1383
if (await new Future .error ("err" )) {
1384
1384
return 42 ;
1385
1385
} else {
@@ -1391,7 +1391,7 @@ main() {
1391
1391
});
1392
1392
1393
1393
test ("await in then" , () {
1394
- f (v) async {
1394
+ f (bool v) async {
1395
1395
if (v) {
1396
1396
return await new Future .value (42 );
1397
1397
}
@@ -1402,7 +1402,7 @@ main() {
1402
1402
});
1403
1403
1404
1404
test ("await err in then" , () {
1405
- f (v) async {
1405
+ f (bool v) async {
1406
1406
if (v) {
1407
1407
return await new Future .error ("err" );
1408
1408
}
@@ -1413,7 +1413,7 @@ main() {
1413
1413
});
1414
1414
1415
1415
test ("await in then with else" , () {
1416
- f (v) async {
1416
+ f (bool v) async {
1417
1417
if (v) {
1418
1418
return await new Future .value (42 );
1419
1419
} else {
@@ -1426,7 +1426,7 @@ main() {
1426
1426
});
1427
1427
1428
1428
test ("await err in then with else" , () {
1429
- f (v) async {
1429
+ f (bool v) async {
1430
1430
if (v) {
1431
1431
return await new Future .error ("err" );
1432
1432
} else {
@@ -1439,7 +1439,7 @@ main() {
1439
1439
});
1440
1440
1441
1441
test ("await in else" , () {
1442
- f (v) async {
1442
+ f (bool v) async {
1443
1443
if (v) {
1444
1444
return 37 ;
1445
1445
} else {
@@ -1452,7 +1452,7 @@ main() {
1452
1452
});
1453
1453
1454
1454
test ("await err in else" , () {
1455
- f (v) async {
1455
+ f (bool v) async {
1456
1456
if (v) {
1457
1457
return 37 ;
1458
1458
} else {
@@ -1465,7 +1465,7 @@ main() {
1465
1465
});
1466
1466
1467
1467
test ("await in else-if test" , () {
1468
- f (v) async {
1468
+ f (bool v) async {
1469
1469
if (v) {
1470
1470
return 37 ;
1471
1471
} else if (! await new Future .value (v)) {
@@ -1480,7 +1480,7 @@ main() {
1480
1480
});
1481
1481
1482
1482
test ("await in else-if then" , () {
1483
- f (v) async {
1483
+ f (bool v) async {
1484
1484
if (v) {
1485
1485
return 37 ;
1486
1486
} else if (! v) {
@@ -1497,47 +1497,47 @@ main() {
1497
1497
1498
1498
group ("conditional operator" , () {
1499
1499
test ("await in test" , () {
1500
- f (v) async {
1500
+ f (bool v) async {
1501
1501
return (await new Future .value (v)) ? 42 : 37 ;
1502
1502
}
1503
1503
1504
1504
return expect42 (f (true ));
1505
1505
});
1506
1506
1507
1507
test ("await err in test" , () {
1508
- f (v) async {
1508
+ f (bool v) async {
1509
1509
return (await new Future .error ("err" )) ? 42 : 37 ;
1510
1510
}
1511
1511
1512
1512
return throwsErr (f (true ));
1513
1513
});
1514
1514
1515
1515
test ("await in then" , () {
1516
- f (v) async {
1516
+ f (bool v) async {
1517
1517
return v ? (await new Future .value (42 )) : 37 ;
1518
1518
}
1519
1519
1520
1520
return expect42 (f (true ));
1521
1521
});
1522
1522
1523
1523
test ("await err in then" , () {
1524
- f (v) async {
1524
+ f (bool v) async {
1525
1525
return v ? (await new Future .error ("err" )) : 37 ;
1526
1526
}
1527
1527
1528
1528
return throwsErr (f (true ));
1529
1529
});
1530
1530
1531
1531
test ("await in else" , () {
1532
- f (v) async {
1532
+ f (bool v) async {
1533
1533
return v ? 37 : (await new Future .value (42 ));
1534
1534
}
1535
1535
1536
1536
return expect42 (f (false ));
1537
1537
});
1538
1538
1539
1539
test ("await err in else" , () {
1540
- f (v) async {
1540
+ f (bool v) async {
1541
1541
return v ? 37 : (await new Future .error ("err" ));
1542
1542
}
1543
1543
0 commit comments