OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 } | 1502 } |
1503 for (size_t flag_index = 0; flag_index < always_false_flags_length; | 1503 for (size_t flag_index = 0; flag_index < always_false_flags_length; |
1504 ++flag_index) { | 1504 ++flag_index) { |
1505 flags.Remove(always_false_flags[flag_index]); | 1505 flags.Remove(always_false_flags[flag_index]); |
1506 } | 1506 } |
1507 TestParserSyncWithFlags(str, flags, result); | 1507 TestParserSyncWithFlags(str, flags, result); |
1508 } | 1508 } |
1509 } | 1509 } |
1510 | 1510 |
1511 | 1511 |
1512 TEST(ParserSync) { | 1512 // TODO(marja) This needs to be turned into a fuzzing test, trying all those |
| 1513 // combinations below takes at least 2 orders of magnitude too long. |
| 1514 DISABLED_TEST(ParserSync) { |
1513 const char* context_data[][2] = { | 1515 const char* context_data[][2] = { |
1514 { "", "" }, | 1516 { "", "" }, |
1515 { "{", "}" }, | 1517 { "{", "}" }, |
1516 { "if (true) ", " else {}" }, | 1518 { "if (true) ", " else {}" }, |
1517 { "if (true) {} else ", "" }, | 1519 { "if (true) {} else ", "" }, |
1518 { "if (true) ", "" }, | 1520 { "if (true) ", "" }, |
1519 { "do ", " while (false)" }, | 1521 { "do ", " while (false)" }, |
1520 { "while (false) ", "" }, | 1522 { "while (false) ", "" }, |
1521 { "for (;;) ", "" }, | 1523 { "for (;;) ", "" }, |
1522 { "with ({})", "" }, | 1524 { "with ({})", "" }, |
(...skipping 2979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4502 always_false_flags, arraysize(always_false_flags)); | 4504 always_false_flags, arraysize(always_false_flags)); |
4503 | 4505 |
4504 const char* good_data[] = { | 4506 const char* good_data[] = { |
4505 "let = 1;", | 4507 "let = 1;", |
4506 "for(let = 1;;){}", | 4508 "for(let = 1;;){}", |
4507 NULL}; | 4509 NULL}; |
4508 RunParserSyncTest(context_data, good_data, kSuccess, NULL, 0, | 4510 RunParserSyncTest(context_data, good_data, kSuccess, NULL, 0, |
4509 always_true_flags, arraysize(always_true_flags), | 4511 always_true_flags, arraysize(always_true_flags), |
4510 always_false_flags, arraysize(always_false_flags)); | 4512 always_false_flags, arraysize(always_false_flags)); |
4511 } | 4513 } |
OLD | NEW |