| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 return len(self.parsed_expectations) > 1 | 272 return len(self.parsed_expectations) > 1 |
| 273 | 273 |
| 274 def is_comment(self): | 274 def is_comment(self): |
| 275 return bool(re.match(r"^\s*#.*$", self.original_string)) | 275 return bool(re.match(r"^\s*#.*$", self.original_string)) |
| 276 | 276 |
| 277 def is_whitespace(self): | 277 def is_whitespace(self): |
| 278 return not self.original_string.strip() | 278 return not self.original_string.strip() |
| 279 | 279 |
| 280 # FIXME: Update the original specifiers and remove this once the old syntax
is gone. | 280 # FIXME: Update the original specifiers and remove this once the old syntax
is gone. |
| 281 _configuration_tokens_list = [ | 281 _configuration_tokens_list = [ |
| 282 'Mac', 'Mac10.9', 'Mac10.10', 'Mac10.11', 'Retina', | 282 'Mac', 'Mac10.9', 'Mac10.10', 'Mac10.11', 'Retina', 'Mac10.12', |
| 283 'Win', 'Win7', 'Win10', | 283 'Win', 'Win7', 'Win10', |
| 284 'Linux', 'Trusty', | 284 'Linux', 'Trusty', |
| 285 'Android', | 285 'Android', |
| 286 'Release', | 286 'Release', |
| 287 'Debug', | 287 'Debug', |
| 288 ] | 288 ] |
| 289 | 289 |
| 290 _configuration_tokens = dict((token, token.upper()) for token in _configurat
ion_tokens_list) | 290 _configuration_tokens = dict((token, token.upper()) for token in _configurat
ion_tokens_list) |
| 291 _inverted_configuration_tokens = dict((value, name) for name, value in _conf
iguration_tokens.iteritems()) | 291 _inverted_configuration_tokens = dict((value, name) for name, value in _conf
iguration_tokens.iteritems()) |
| 292 | 292 |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. | 1211 # If reconstitute_only_these is an empty list, we want to return ori
ginal_string. |
| 1212 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. | 1212 # So we need to compare reconstitute_only_these to None, not just ch
eck if it's falsey. |
| 1213 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: | 1213 if reconstitute_only_these is None or expectation_line in reconstitu
te_only_these: |
| 1214 return expectation_line.to_string(test_configuration_converter) | 1214 return expectation_line.to_string(test_configuration_converter) |
| 1215 return expectation_line.original_string | 1215 return expectation_line.original_string |
| 1216 | 1216 |
| 1217 def nones_out(expectation_line): | 1217 def nones_out(expectation_line): |
| 1218 return expectation_line is not None | 1218 return expectation_line is not None |
| 1219 | 1219 |
| 1220 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) | 1220 return '\n'.join(filter(nones_out, map(serialize, expectation_lines))) |
| OLD | NEW |