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

Unified Diff: runtime/vm/scanner_test.cc

Issue 9240014: Set breakpoint at url, line number (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 | « runtime/vm/scanner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scanner_test.cc
===================================================================
--- runtime/vm/scanner_test.cc (revision 3419)
+++ runtime/vm/scanner_test.cc (working copy)
@@ -331,6 +331,23 @@
}
+void FindLineTest() {
+ const char* source =
+ "/*1*/ \n"
+ "/*2*/ class A {\n"
+ "/*3*/ void foo() { }\n"
+ "/*4*/ }\n";
+
+ Scanner scanner(String::Handle(String::New(source)),
+ String::Handle(String::New("")));
+
+ intptr_t token_index = scanner.TokenIndexAtLine(3);
+ EXPECT_EQ(3, token_index);
+ token_index = scanner.TokenIndexAtLine(100);
+ EXPECT(token_index < 0);
+}
+
+
TEST_CASE(Scanner_Test) {
ScanLargeText();
@@ -344,6 +361,7 @@
EmptyMultilineString();
NumberLiteral();
InvalidText();
+ FindLineTest();
}
} // namespace dart
« no previous file with comments | « runtime/vm/scanner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698