Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Oct 26, 2022
1 parent 36a87b4 commit e557b79
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -977,15 +977,15 @@ fn test_fold_comparison4() {

#[test]
fn test_fold_get_elem1() {
fold("x = [,10][0]", "x = void 0");
fold("x = [10, 20][0]", "x = 10");
fold("x = [10, 20][1]", "x = 20");
fold("x = [,10][0]", "x = (0, void 0)");
fold("x = [10, 20][0]", "x = (0, 10)");
fold("x = [10, 20][1]", "x = (0, 20)");

// fold("x = [10, 20][-1]", "x = void 0;");
// fold("x = [10, 20][2]", "x = void 0;");

fold("x = [foo(), 0][1]", "x = (foo(), 0);");
fold("x = [0, foo()][1]", "x = foo()");
fold("x = [0, foo()][1]", "x = (0, foo())");
// fold("x = [0, foo()][0]", "x = (foo(), 0)");
fold_same("for([1][0] in {});");
}
Expand All @@ -1008,11 +1008,11 @@ fn test_fold_get_elem2_2() {

#[test]
fn test_fold_array_lit_spread_get_elem() {
fold("x = [...[0 ]][0]", "x = 0;");
fold("x = [0, 1, ...[2, 3, 4]][3]", "x = 3;");
fold("x = [...[0, 1], 2, ...[3, 4]][3]", "x = 3;");
fold("x = [...[...[0, 1], 2, 3], 4][0]", "x = 0");
fold("x = [...[...[0, 1], 2, 3], 4][3]", "x = 3");
fold("x = [...[0 ]][0]", "x = (0, 0);");
fold("x = [0, 1, ...[2, 3, 4]][3]", "x = (0, 3);");
fold("x = [...[0, 1], 2, ...[3, 4]][3]", "x = (0, 3);");
fold("x = [...[...[0, 1], 2, 3], 4][0]", "x = (0, 0)");
fold("x = [...[...[0, 1], 2, 3], 4][3]", "x = (0, 3)");
// fold("x = [...[]][100]", "x = void 0;");
// fold("x = [...[0]][100]", "x = void 0;");
}
Expand Down

0 comments on commit e557b79

Please sign in to comment.