| 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 import 'test_try.dart'; | |
| 6 | |
| 7 InteractionContext interaction; | |
| 8 | |
| 9 void main() { | |
| 10 interaction = mockTryDartInteraction(); | |
| 11 | |
| 12 runTests(<TestCase>[ | |
| 13 | |
| 14 new TestCase('Test setting full source', () { | |
| 15 clearEditorPaneWithoutNotifications(); | |
| 16 mainEditorPane.appendText('Foo\nBar'); | |
| 17 }, () { | |
| 18 expectSource('Foo\nBar'); | |
| 19 }), | |
| 20 | |
| 21 new TestCase('Test modifying a single line', () { | |
| 22 Element lastLine = mainEditorPane.lastChild; | |
| 23 lastLine.appendText('Baz'); | |
| 24 }, () { | |
| 25 expectSource('Foo\nBarBaz'); | |
| 26 }), | |
| 27 | |
| 28 ]); | |
| 29 } | |
| 30 | |
| 31 void expectSource(String expected) { | |
| 32 String actualSource = interaction.currentCompilationUnit.content; | |
| 33 Expect.stringEquals(expected, actualSource); | |
| 34 } | |
| OLD | NEW |