98523c01f8
R=floitsch@google.com, johnniwinther@google.com Review URL: https://codereview.chromium.org//341923005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37538 260f80e4-7a28-3924-810f-c04153c831b5
35 lines
907 B
Dart
35 lines
907 B
Dart
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'test_try.dart';
|
|
|
|
InteractionContext interaction;
|
|
|
|
void main() {
|
|
interaction = mockTryDartInteraction();
|
|
|
|
runTests(<TestCase>[
|
|
|
|
new TestCase('Test setting full source', () {
|
|
clearEditorPaneWithoutNotifications();
|
|
mainEditorPane.appendText('Foo\nBar');
|
|
}, () {
|
|
expectSource('Foo\nBar');
|
|
}),
|
|
|
|
new TestCase('Test modifying a single line', () {
|
|
Element lastLine = mainEditorPane.lastChild;
|
|
lastLine.appendText('Baz');
|
|
}, () {
|
|
expectSource('Foo\nBarBaz');
|
|
}),
|
|
|
|
]);
|
|
}
|
|
|
|
void expectSource(String expected) {
|
|
String actualSource = interaction.currentCompilationUnit.content;
|
|
Expect.stringEquals(expected, actualSource);
|
|
}
|