OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import 'package:compiler/src/util/util.dart' show Indentation; | 6 import 'package:compiler/implementation/util/util.dart' show Indentation; |
7 | 7 |
8 main() { | 8 main() { |
9 Indentation ind = new Indentation(); | 9 Indentation ind = new Indentation(); |
10 | 10 |
11 Expect.stringEquals("", ind.indentation); | 11 Expect.stringEquals("", ind.indentation); |
12 | 12 |
13 ind.indentMore(); | 13 ind.indentMore(); |
14 Expect.stringEquals(ind.indentationUnit, ind.indentation); | 14 Expect.stringEquals(ind.indentationUnit, ind.indentation); |
15 | 15 |
16 ind.indentMore(); | 16 ind.indentMore(); |
17 Expect.stringEquals(ind.indentationUnit * 2, ind.indentation); | 17 Expect.stringEquals(ind.indentationUnit * 2, ind.indentation); |
18 | 18 |
19 ind.indentBlock( | 19 ind.indentBlock( |
20 () => Expect.stringEquals(ind.indentationUnit * 3, ind.indentation)); | 20 () => Expect.stringEquals(ind.indentationUnit * 3, ind.indentation)); |
21 Expect.stringEquals(ind.indentationUnit * 2, ind.indentation); | 21 Expect.stringEquals(ind.indentationUnit * 2, ind.indentation); |
22 | 22 |
23 ind.indentationUnit = "x"; | 23 ind.indentationUnit = "x"; |
24 Expect.stringEquals("xx", ind.indentation); | 24 Expect.stringEquals("xx", ind.indentation); |
25 | 25 |
26 ind.indentLess(); | 26 ind.indentLess(); |
27 Expect.stringEquals("x", ind.indentation); | 27 Expect.stringEquals("x", ind.indentation); |
28 | 28 |
29 ind.indentLess(); | 29 ind.indentLess(); |
30 Expect.stringEquals("", ind.indentation); | 30 Expect.stringEquals("", ind.indentation); |
31 | 31 |
32 ind.indentMore(); | 32 ind.indentMore(); |
33 Expect.stringEquals("x", ind.indentation); | 33 Expect.stringEquals("x", ind.indentation); |
34 } | 34 } |
OLD | NEW |