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

Unified Diff: lib/unittest/html_enhanced_config.dart

Issue 10636035: Fix the normalization of test group names before use as DOM class or id names. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/unittest/html_enhanced_config.dart
===================================================================
--- lib/unittest/html_enhanced_config.dart (revision 9065)
+++ lib/unittest/html_enhanced_config.dart (working copy)
@@ -133,14 +133,14 @@
}
);
+ var nonAlphanumeric = new RegExp('[^a-z0-9A-Z]');
+
// output group headers and test rows
for (final test_ in flattened) {
// replace everything but numbers and letters from the group name with
// '_' so we can use in id and class properties.
- var safeGroup = test_.currentGroup
- .replaceAll("(?:[^a-z0-9 ]|(?<=['\"])s)",'_')
- .replaceAll(' ','_');
+ var safeGroup = test_.currentGroup.replaceAll(nonAlphanumeric,'_');
Siggi Cherem (dart-lang) 2012/06/25 21:37:23 add space after ','
if (test_.currentGroup != previousGroup){
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698