Skip to content

Commit 6622522

Browse files
kevmoonex3
authored andcommitted
Enable Travis-CI (flutter#19)
Fixes flutter#18
1 parent a2ad0b8 commit 6622522

File tree

11 files changed

+98
-106
lines changed

11 files changed

+98
-106
lines changed

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
language: dart
2+
3+
dart:
4+
- dev
5+
- stable
6+
7+
dart_task:
8+
- test: --platform vm,chrome
9+
10+
matrix:
11+
include:
12+
# Only validate formatting using the dev release
13+
- dart: dev
14+
dart_task: dartfmt
15+
- dart: dev
16+
dart_task: dartanalyzer
17+
18+
# Only building master means that we don't run two builds for each pull request.
19+
branches:
20+
only: [master]
21+
22+
cache:
23+
directories:
24+
- $HOME/.pub-cache

lib/src/colors.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ const String RED = '\u001b[31m';
88
const String YELLOW = '\u001b[33m';
99

1010
const String NONE = '\u001b[0m';
11-

lib/src/file.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ class SourceFile {
5353
///
5454
/// Use [new SourceFile.fromString] instead.
5555
@Deprecated("Will be removed in 2.0.0")
56-
SourceFile(String text, {url})
57-
: this.decoded(text.runes, url: url);
56+
SourceFile(String text, {url}) : this.decoded(text.runes, url: url);
5857

5958
/// Creates a new source file from [text].
6059
///
@@ -317,7 +316,6 @@ class _FileSpan extends SourceSpanMixin implements FileSpan {
317316
SourceSpan union(SourceSpan other) {
318317
if (other is! FileSpan) return super.union(other);
319318

320-
321319
_FileSpan span = expand(other);
322320

323321
if (other is _FileSpan) {
@@ -339,7 +337,8 @@ class _FileSpan extends SourceSpanMixin implements FileSpan {
339337
return super == other && sourceUrl == other.sourceUrl;
340338
}
341339

342-
return _start == other._start && _end == other._end &&
340+
return _start == other._start &&
341+
_end == other._end &&
343342
sourceUrl == other.sourceUrl;
344343
}
345344

lib/src/location.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ class SourceLocation implements Comparable<SourceLocation> {
8282
}
8383

8484
bool operator ==(other) =>
85-
other is SourceLocation && sourceUrl == other.sourceUrl &&
85+
other is SourceLocation &&
86+
sourceUrl == other.sourceUrl &&
8687
offset == other.offset;
8788

8889
int get hashCode => sourceUrl.hashCode + offset;

lib/src/location_mixin.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,3 @@ abstract class SourceLocationMixin implements SourceLocation {
4646

4747
String toString() => '<$runtimeType: $offset $toolString>';
4848
}
49-

lib/src/span_mixin.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ abstract class SourceSpanMixin implements SourceSpan {
113113
return buffer.toString();
114114
}
115115

116-
bool operator ==(other) => other is SourceSpan &&
117-
start == other.start && end == other.end;
116+
bool operator ==(other) =>
117+
other is SourceSpan && start == other.start && end == other.end;
118118

119119
int get hashCode => start.hashCode + (31 * end.hashCode);
120120

lib/src/span_with_context.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SourceSpanWithContext extends SourceSpanBase {
2222
/// [text] should start at `start.column` from the beginning of a line in
2323
/// [context].
2424
SourceSpanWithContext(
25-
SourceLocation start, SourceLocation end, String text, this._context)
25+
SourceLocation start, SourceLocation end, String text, this._context)
2626
: super(start, end, text) {
2727
if (!context.contains(text)) {
2828
throw new ArgumentError(

test/file_test.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ zip zap zop""", url: "foo.dart");
8787
test("column may not be outside the file", () {
8888
expect(() => file.getOffset(2, 100), throwsRangeError);
8989
});
90-
90+
9191
test("column may not be outside the line", () {
9292
expect(() => file.getOffset(1, 20), throwsRangeError);
9393
});
@@ -109,8 +109,8 @@ zip zap zop""", url: "foo.dart");
109109

110110
group("for span().union()", () {
111111
test("source URLs must match", () {
112-
var other = new SourceSpan(
113-
new SourceLocation(10), new SourceLocation(11), "_");
112+
var other =
113+
new SourceSpan(new SourceLocation(10), new SourceLocation(11), "_");
114114

115115
expect(() => file.span(9, 10).union(other), throwsArgumentError);
116116
});
@@ -312,10 +312,8 @@ zip zap zop""", url: "bar.dart").span(10, 11);
312312
});
313313

314314
test("returns a base SourceSpan for a SourceSpan input", () {
315-
var other = new SourceSpan(
316-
new SourceLocation(0, sourceUrl: "foo.dart"),
317-
new SourceLocation(5, sourceUrl: "foo.dart"),
318-
"hey, ");
315+
var other = new SourceSpan(new SourceLocation(0, sourceUrl: "foo.dart"),
316+
new SourceLocation(5, sourceUrl: "foo.dart"), "hey, ");
319317
var result = span.union(other);
320318
expect(result, isNot(new isInstanceOf<FileSpan>()));
321319
expect(result.start, equals(other.start));

test/highlight_test.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,19 @@ zip zap zop
6262
});
6363

6464
test("works for a point span in an empty file", () {
65-
expect(new SourceFile("").location(0).pointSpan().highlight(),
66-
equals("""
65+
expect(new SourceFile("").location(0).pointSpan().highlight(), equals("""
6766
6867
^"""));
6968
});
7069

7170
test("works for a single-line file without a newline", () {
72-
expect(new SourceFile("foo bar").span(0, 7).highlight(),
73-
equals("""
71+
expect(new SourceFile("foo bar").span(0, 7).highlight(), equals("""
7472
foo bar
7573
^^^^^^^"""));
7674
});
7775

7876
test("emits tabs for tabs", () {
79-
expect(new SourceFile(" \t \t\tfoo bar").span(5, 8).highlight(),
80-
equals("""
77+
expect(new SourceFile(" \t \t\tfoo bar").span(5, 8).highlight(), equals("""
8178
\t \t\tfoo bar
8279
\t \t\t^^^"""));
8380
});

test/location_test.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import 'package:source_span/source_span.dart';
88
main() {
99
var location;
1010
setUp(() {
11-
location = new SourceLocation(15,
12-
line: 2, column: 6, sourceUrl: "foo.dart");
11+
location =
12+
new SourceLocation(15, line: 2, column: 6, sourceUrl: "foo.dart");
1313
});
1414

1515
group('errors', () {
@@ -28,13 +28,13 @@ main() {
2828
});
2929

3030
test('for distance() source URLs must match', () {
31-
expect(() => location.distance(new SourceLocation(0)),
32-
throwsArgumentError);
31+
expect(
32+
() => location.distance(new SourceLocation(0)), throwsArgumentError);
3333
});
3434

3535
test('for compareTo() source URLs must match', () {
36-
expect(() => location.compareTo(new SourceLocation(0)),
37-
throwsArgumentError);
36+
expect(
37+
() => location.compareTo(new SourceLocation(0)), throwsArgumentError);
3838
});
3939
});
4040

@@ -81,7 +81,6 @@ main() {
8181
});
8282
});
8383

84-
8584
group("equality", () {
8685
test("two locations with the same offset and source are equal", () {
8786
var other = new SourceLocation(15, sourceUrl: "foo.dart");

0 commit comments

Comments
 (0)