OLD | NEW |
---|---|
1 library Suites; | 1 library Suites; |
2 | 2 |
3 class Origin { | 3 class Origin { |
4 final String author; | 4 final String author; |
5 final String url; | 5 final String url; |
6 | 6 |
7 const Origin(this.author, this.url); | 7 const Origin(this.author, this.url); |
8 } | 8 } |
9 | 9 |
10 class SuiteDescription { | 10 class SuiteDescription { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 return path.replaceFirst('.html', '$lib.html'); | 85 return path.replaceFirst('.html', '$lib.html'); |
86 case 'frog': | 86 case 'frog': |
87 case 'dart2js': | 87 case 'dart2js': |
88 return '$platform/${path.replaceFirst(".html", "$lib-js.html")}'; | 88 return '$platform/${path.replaceFirst(".html", "$lib-js.html")}'; |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 static var _SUITE_DESCRIPTIONS; | 92 static var _SUITE_DESCRIPTIONS; |
93 | 93 |
94 static List<SuiteDescription> get SUITE_DESCRIPTIONS { | 94 static List<SuiteDescription> get SUITE_DESCRIPTIONS { |
95 if (null !== _SUITE_DESCRIPTIONS) { | 95 if (null != _SUITE_DESCRIPTIONS) { |
Lasse Reichstein Nielsen
2012/11/12 13:10:41
Swap operands, this is unreadable.
floitsch
2012/11/12 22:18:43
Done.
| |
96 return _SUITE_DESCRIPTIONS; | 96 return _SUITE_DESCRIPTIONS; |
97 } | 97 } |
98 _SUITE_DESCRIPTIONS = <SuiteDescription>[]; | 98 _SUITE_DESCRIPTIONS = <SuiteDescription>[]; |
99 | 99 |
100 // Expand the list to include a unique SuiteDescription for each | 100 // Expand the list to include a unique SuiteDescription for each |
101 // tested variant. | 101 // tested variant. |
102 for (SuiteDescription suite in _CORE_SUITE_DESCRIPTIONS) { | 102 for (SuiteDescription suite in _CORE_SUITE_DESCRIPTIONS) { |
103 List variants = suite.testVariants; | 103 List variants = suite.testVariants; |
104 for (List variant in variants) { | 104 for (List variant in variants) { |
105 assert(variant.length == 2); | 105 assert(variant.length == 2); |
106 String platform = variant[0]; | 106 String platform = variant[0]; |
107 List<String> libraries = variant[1]; | 107 List<String> libraries = variant[1]; |
108 for(String lib in libraries) { | 108 for(String lib in libraries) { |
109 String path = _getHtmlPathForVariant(platform, lib, suite.file); | 109 String path = _getHtmlPathForVariant(platform, lib, suite.file); |
110 final combined = new List.from(suite.tags); | 110 final combined = new List.from(suite.tags); |
111 combined.add(platform); | 111 combined.add(platform); |
112 if (lib != '') { | 112 if (lib != '') { |
113 combined.add(lib); | 113 combined.add(lib); |
114 lib = ':$lib'; | 114 lib = ':$lib'; |
115 } | 115 } |
116 final name = null === variant | 116 final name = null == variant |
Lasse Reichstein Nielsen
2012/11/12 13:10:41
ditto here. And parenthesize the comparison.
floitsch
2012/11/12 22:18:43
Done.
| |
117 ? suite.name | 117 ? suite.name |
118 : '${suite.name} ($platform$lib)'; | 118 : '${suite.name} ($platform$lib)'; |
119 _SUITE_DESCRIPTIONS.add(new SuiteDescription( | 119 _SUITE_DESCRIPTIONS.add(new SuiteDescription( |
120 path, | 120 path, |
121 name, | 121 name, |
122 suite.origin, | 122 suite.origin, |
123 suite.description, | 123 suite.description, |
124 combined, | 124 combined, |
125 [])); | 125 [])); |
126 } | 126 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 return CATEGORIES[tags]; | 158 return CATEGORIES[tags]; |
159 } | 159 } |
160 for (final suite in _CORE_SUITE_DESCRIPTIONS) { | 160 for (final suite in _CORE_SUITE_DESCRIPTIONS) { |
161 if (suite.tags[0] == tags) { | 161 if (suite.tags[0] == tags) { |
162 return suite.name; | 162 return suite.name; |
163 } | 163 } |
164 } | 164 } |
165 return null; | 165 return null; |
166 } | 166 } |
167 } | 167 } |
OLD | NEW |