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

Unified Diff: src/tests/site/code/testing.dart

Issue 83663005: added front page samples to testing, plus a couple of tweaks to front page and code lab (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: put front page code snippets under testing, minor tweaks, fixed carousel height problem Created 7 years, 1 month 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: src/tests/site/code/testing.dart
diff --git a/src/tests/site/code/testing.dart b/src/tests/site/code/testing.dart
new file mode 100644
index 0000000000000000000000000000000000000000..556a7ca9ef80cb0804988a0b0c4d90f922673d28
--- /dev/null
+++ b/src/tests/site/code/testing.dart
@@ -0,0 +1,20 @@
+import 'package:unittest/unittest.dart';
+import 'dart:math' show Point;
+
+main() {
+ Point a = new Point(2, 15);
+ Point b = new Point(7, 3);
+
+ test('point distances', () {
+ expect(a.distanceTo(b), equals(13));
+ });
+ test('point magnitude close to', () {
+ expect(a.magnitude, closeTo(15, .25));
+ });
+ test('point magnitude greater than', () {
+ expect(a.magnitude, greaterThan(b.magnitude));
+ });
+ test('point == operator', () {
+ expect(a == b, equals(false));
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698