mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
add fixture file for Dart
This commit is contained in:
15
test/fixtures/point.dart
vendored
Normal file
15
test/fixtures/point.dart
vendored
Normal file
@@ -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)}');
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user