OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'package:unittest/unittest.dart'; | 5 import 'package:test/test.dart'; |
6 import 'package:source_span/source_span.dart'; | 6 import 'package:source_span/source_span.dart'; |
7 import 'package:source_span/src/colors.dart' as colors; | 7 import 'package:source_span/src/colors.dart' as colors; |
8 | 8 |
9 main() { | 9 main() { |
10 var file; | 10 var file; |
11 setUp(() { | 11 setUp(() { |
12 file = new SourceFile(""" | 12 file = new SourceFile(""" |
13 foo bar baz | 13 foo bar baz |
14 whiz bang boom | 14 whiz bang boom |
15 zip zap zop | 15 zip zap zop |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 }); | 91 }); |
92 | 92 |
93 test("uses the given color if it's passed", () { | 93 test("uses the given color if it's passed", () { |
94 expect(file.span(4, 7).message("oh no", color: colors.YELLOW), equals(""" | 94 expect(file.span(4, 7).message("oh no", color: colors.YELLOW), equals(""" |
95 line 1, column 5 of foo.dart: oh no | 95 line 1, column 5 of foo.dart: oh no |
96 foo ${colors.YELLOW}bar${colors.NONE} baz | 96 foo ${colors.YELLOW}bar${colors.NONE} baz |
97 ${colors.YELLOW}^^^${colors.NONE}""")); | 97 ${colors.YELLOW}^^^${colors.NONE}""")); |
98 }); | 98 }); |
99 }); | 99 }); |
100 } | 100 } |
OLD | NEW |