Skip to content

Commit

Permalink
add fixture file for Dart
Browse files Browse the repository at this point in the history
  • Loading branch information
igrigorik committed Apr 9, 2012
1 parent a3dc9fb commit cb715e2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/fixtures/point.dart
@@ -0,0 +1,15 @@
class Point {
Point(this.x, this.y);
distanceTo(Point other) {
var dx = x - other.x;
var dy = y - other.y;
return Math.sqrt(dx * dx + dy * dy);
}
var x, y;
}

main() {
Point p = new Point(2, 3);
Point q = new Point(3, 4);
print('distance from p to q = ${p.distanceTo(q)}');
}

0 comments on commit cb715e2

Please sign in to comment.