Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: test/browser/language_tests.js

Issue 1316723003: implement null aware ops, fixes #249 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/js/nodes.dart ('k') | test/codegen/language/async_star_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 (function() { 5 (function() {
6 'use strict'; 6 'use strict';
7 7
8 let _isolate_helper = dart_library.import('dart/_isolate_helper'); 8 let _isolate_helper = dart_library.import('dart/_isolate_helper');
9 _isolate_helper.startRootIsolate(function() {}, []); 9 _isolate_helper.startRootIsolate(function() {}, []);
10
11 let async_helper = dart_library.import('async_helper/async_helper'); 10 let async_helper = dart_library.import('async_helper/async_helper');
12 11
12 function dartLanguageTest(name) {
13 test(name, (done) => {
14 async_helper.asyncTestInitialize(done);
15 console.debug('Running language test: ' + name);
16 dart_library.import('language/' + name).main();
17 if (!async_helper.asyncTestStarted) done();
18 });
19 }
20
13 function dartLanguageTests(tests) { 21 function dartLanguageTests(tests) {
14 for (const name of tests) { 22 for (let name of tests) {
15 test(name, (done) => { 23 if (name instanceof Array) {
16 async_helper.asyncTestInitialize(done); 24 let multitestName = name[0];
17 console.debug('Running language test: ' + name); 25 let testCases = name.slice(1);
18 dart_library.import('language/' + name).main(); 26 for (let testCase of testCases) {
19 if (!async_helper.asyncTestStarted) done(); 27 if (typeof testCase == 'number') {
20 }); 28 testCase = (testCase < 10 ? '0' : '') + testCase;
29 }
30 dartLanguageTest(`${multitestName}_${testCase}_multi`);
31 }
32 } else {
33 dartLanguageTest(name);
34 }
21 } 35 }
22 } 36 }
23 37
38 suite('null aware ops', () => {
39 dartLanguageTests([
40 ['conditional_method_invocation_test', 'none', 1, 2, 3, 4],
41 ['conditional_property_access_test', 'none', 1, 2, 3],
42 ['conditional_property_assignment_test', 'none', 1, 2, 3, 7, 8, 9],
43 ['conditional_property_increment_decrement_test',
44 'none', 1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15],
45 ['if_null_assignment_behavior_test', 'none',
46 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24,
47 25, 26, 27, 28, 31, 32],
48 ['if_null_assignment_static_test', 'none',
49 1, 3, 5, 8, 10, 12, 15, 17, 19, 22, 24, 26, 29, 31, 33, 36, 38, 40],
50 'nullaware_opt_test',
51 ['super_conditional_operator_test', 'none'],
52 ['this_conditional_operator_test', 'none']
53 ]);
54 });
55
24 suite('sync*', () => { 56 suite('sync*', () => {
25 test('syncstar_syntax', () => { 57 test('syncstar_syntax', () => {
26 dart_library.import('syncstar_syntax').main(); 58 dart_library.import('syncstar_syntax').main();
27 }); 59 });
28 60
29 dartLanguageTests([ 61 dartLanguageTests([
30 'syncstar_yield_test', 62 'syncstar_yield_test',
31 'syncstar_yieldstar_test' 63 'syncstar_yieldstar_test'
32 ]); 64 ]);
33 }); 65 });
(...skipping 19 matching lines...) Expand all
53 // TODO(jmesserly): fix errors 85 // TODO(jmesserly): fix errors
54 // 'async_return_types_test', 86 // 'async_return_types_test',
55 // TODO(jmesserly): https://github.com/dart-lang/dev_compiler/issues/294 87 // TODO(jmesserly): https://github.com/dart-lang/dev_compiler/issues/294
56 // 'async_switch_test', 88 // 'async_switch_test',
57 'async_test', 89 'async_test',
58 'async_this_bound_test', 90 'async_this_bound_test',
59 'async_throw_in_catch_test' 91 'async_throw_in_catch_test'
60 ]); 92 ]);
61 }); 93 });
62 94
63 dart_library.import('language/async_star_test').main(); 95 dart_library.import('language/async_star_test_none_multi').main();
64 96
65 suite('async*', () => { 97 suite('async*', () => {
66 dartLanguageTests([ 98 dartLanguageTests([
67 // TODO(jmesserly): figure out why this test is hanging. 99 // TODO(jmesserly): figure out why this test is hanging.
68 //'async_star_cancel_and_throw_in_finally_test', 100 //'async_star_cancel_and_throw_in_finally_test',
69 'async_star_regression_23116_test', 101 'async_star_regression_23116_test',
70 'asyncstar_concat_test', 102 'asyncstar_concat_test',
71 // TODO(jmesserly): https://github.com/dart-lang/dev_compiler/issues/294 103 // TODO(jmesserly): https://github.com/dart-lang/dev_compiler/issues/294
72 // 'asyncstar_throw_in_catch_test', 104 // 'asyncstar_throw_in_catch_test',
73 'asyncstar_yield_test', 105 'asyncstar_yield_test',
74 'asyncstar_yieldstar_test' 106 'asyncstar_yieldstar_test'
75 ]); 107 ]);
76 }); 108 });
77 109
78 suite('export', () => { 110 suite('export', () => {
79 dartLanguageTests([ 111 dartLanguageTests([
80 'duplicate_export_test', 112 'duplicate_export_test',
81 'export_cyclic_test', 113 'export_cyclic_test',
82 'export_double_same_main_test', 114 'export_double_same_main_test',
83 'export_main_override_test', 115 'export_main_override_test',
84 'export_main_test', 116 'export_main_test',
85 'export_test', 117 'export_test',
86 'local_export_test', 118 'local_export_test',
87 'reexport_core_test', 119 'reexport_core_test',
88 'top_level_entry_test' 120 'top_level_entry_test'
89 ]); 121 ]);
90 }); 122 });
91 123
92 })(); 124 })();
OLDNEW
« no previous file with comments | « lib/src/js/nodes.dart ('k') | test/codegen/language/async_star_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698