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

Unified Diff: tests/compiler/dart2js/strip_comment_test.dart

Issue 11726005: Dartdoc comments retrieved as metadata through dart2js mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 12 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
Index: tests/compiler/dart2js/strip_comment_test.dart
diff --git a/tests/compiler/dart2js/strip_comment_test.dart b/tests/compiler/dart2js/strip_comment_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b8c4943c0be925d0ff62ac1e8ad67fb779b31407
--- /dev/null
+++ b/tests/compiler/dart2js/strip_comment_test.dart
@@ -0,0 +1,79 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library strip_comment_test;
+
+import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart';
+
+testComment(String strippedText, String commentText) {
+ Expect.stringEquals(strippedText, stripComment(commentText));
+}
+
+void main() {
+ testComment('', '//');
+ testComment('', '// ');
+ testComment('', '// ');
ahe 2013/01/08 11:59:43 Did you mean: testComment(' ', '// ');
Johnni Winther 2013/01/08 13:39:46 Yes. Done.
+ testComment('foo bar baz', '//foo bar baz');
+ testComment('foo bar baz', '// foo bar baz');
+ testComment('foo bar baz ', '// foo bar baz ');
+ testComment(' foo bar baz ', '// foo bar baz ');
+
+ testComment('', '///');
+ testComment('', '/// ');
+ testComment('', '/// ');
ahe 2013/01/08 11:59:43 Ditto?
Johnni Winther 2013/01/08 13:39:46 Done.
+ testComment('foo bar baz', '///foo bar baz');
+ testComment('foo bar baz', '/// foo bar baz');
+ testComment('foo bar baz ', '/// foo bar baz ');
+ testComment(' foo bar baz ', '/// foo bar baz ');
+
+ testComment('', '/**/');
+ testComment('', '/* */');
+ testComment(' ', '/* */');
+ testComment('foo bar baz', '/*foo bar baz*/');
+ testComment('foo bar baz', '/* foo bar baz*/');
+ testComment('foo bar baz ', '/* foo bar baz */');
+ testComment(' foo bar baz ', '/* foo bar baz */');
+ testComment('foo\nbar\nbaz', '/*foo\nbar\nbaz*/');
+ testComment('foo\nbar\nbaz', '/* foo\nbar\nbaz*/');
+ testComment('foo \n bar \n baz ', '/* foo \n bar \n baz */');
+ testComment('foo\nbar\nbaz', '/* foo\n *bar\n *baz*/');
+ testComment('foo\nbar\nbaz', '/* foo\n * bar\n * baz*/');
+ testComment('foo \nbar \nbaz ', '/* foo \n * bar \n * baz */');
+ testComment('\nfoo\nbar\nbaz',
+ '''/*
+ * foo
+ * bar
+ * baz*/''');
+ testComment('\nfoo\nbar\nbaz\n',
+ '''/*
+ * foo
+ * bar
+ * baz
+ */''');
+
+ testComment('', '/***/');
+ testComment('', '/** */');
+ testComment(' ', '/** */');
+ testComment('foo bar baz', '/**foo bar baz*/');
+ testComment('foo bar baz', '/** foo bar baz*/');
+ testComment('foo bar baz ', '/** foo bar baz */');
+ testComment(' foo bar baz ', '/** foo bar baz */');
+ testComment('foo\nbar\nbaz', '/**foo\nbar\nbaz*/');
+ testComment('foo\nbar\nbaz', '/** foo\nbar\nbaz*/');
+ testComment('foo \n bar \n baz ', '/** foo \n bar \n baz */');
+ testComment('foo\nbar\nbaz', '/** foo\n *bar\n *baz*/');
+ testComment('foo\nbar\nbaz', '/** foo\n * bar\n * baz*/');
+ testComment('foo \nbar \nbaz ', '/** foo \n * bar \n * baz */');
+ testComment('\nfoo\nbar\nbaz',
+ '''/**
+ * foo
+ * bar
+ * baz*/''');
+ testComment('\nfoo\nbar\nbaz\n',
+ '''/**
+ * foo
+ * bar
+ * baz
+ */''');
+}

Powered by Google App Engine
This is Rietveld 408576698