| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // SharedOptions=--package-root=sdk/lib/_internal/ |
| 6 |
| 7 import 'test_try.dart'; |
| 8 |
| 9 InteractionContext interaction; |
| 10 |
| 11 void main() { |
| 12 interaction = mockTryDartInteraction(); |
| 13 |
| 14 runTests(<TestCase>[ |
| 15 |
| 16 new TestCase('Test setting full source', () { |
| 17 clearEditorPaneWithoutNotifications(); |
| 18 mainEditorPane.appendText('Foo\nBar'); |
| 19 }, () { |
| 20 expectSource('Foo\nBar'); |
| 21 }), |
| 22 |
| 23 new TestCase('Test modifying a single line', () { |
| 24 Element lastLine = mainEditorPane.lastChild; |
| 25 lastLine.appendText('Baz'); |
| 26 }, () { |
| 27 expectSource('Foo\nBarBaz'); |
| 28 }), |
| 29 |
| 30 ]); |
| 31 } |
| 32 |
| 33 void expectSource(String expected) { |
| 34 String actualSource = interaction.currentCompilationUnit.content; |
| 35 Expect.stringEquals(expected, actualSource); |
| 36 } |
| OLD | NEW |