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

Unified Diff: LayoutTests/dart/fib.dart

Issue 1532413002: Added Dartium changes onto 45.0.2454.104 (Closed) Base URL: http://src.chromium.org/blink/branches/chromium/2454
Patch Set: Created 5 years 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 | « LayoutTests/dart/exception-expected.txt ('k') | LayoutTests/dart/fib.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/dart/fib.dart
diff --git a/LayoutTests/dart/fib.dart b/LayoutTests/dart/fib.dart
new file mode 100644
index 0000000000000000000000000000000000000000..2d8fcc08e618051d3c50aecd2f06408eed87c8bb
--- /dev/null
+++ b/LayoutTests/dart/fib.dart
@@ -0,0 +1,28 @@
+part of fib.app;
+
+class Main {
+ static int fib(int n) {
+ if (n < 2)
+ return n;
+ else
+ return fib(n - 1) + fib(n - 2);
+ }
+
+ // FIXME: Make this a unit test.
+ static BodyElement get body => document.body;
+
+ static void main() {
+ log("fib(10) = ${fib(10)}");
+ if (fib(10) != 55) {
+ log("FAIL");
+ return;
+ }
+ log("PASS");
+ }
+
+ static void log(String msg) {
+ Element element = new Element.tag('div');
+ element.innerHtml = msg;
+ body.nodes.add(element);
+ }
+}
« no previous file with comments | « LayoutTests/dart/exception-expected.txt ('k') | LayoutTests/dart/fib.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698