21 {
22 final CharSequence oldText = "hell";
23 final CharSequence textAfterChange = "hello";
24
25 final int oldComposingStart = 0;
26 final int oldComposingEnd = 4;
27
28 final int startOfReplacementText = 0;
29 final int endOfReplacementText = textAfterChange.length();
30
31 final int newSelectionStart = 5;
32 final int newSelectionEnd = 5;
33 final int newComposingStart = 0;
34 final int newComposingEnd = 5;
35
36 final TextEditingDelta
delta =
37 new TextEditingDelta(
38 oldText,
39 oldComposingStart,
40 oldComposingEnd,
41 textAfterChange,
42 newSelectionStart,
43 newSelectionEnd,
44 newComposingStart,
45 newComposingEnd);
46
47 assertEquals(oldText,
delta.getOldText());
48 assertEquals(textAfterChange,
delta.getDeltaText());
49 assertEquals(oldComposingStart,
delta.getDeltaStart());
50 assertEquals(oldComposingEnd,
delta.getDeltaEnd());
51 assertEquals(newSelectionStart,
delta.getNewSelectionStart());
52 assertEquals(newSelectionEnd,
delta.getNewSelectionEnd());
53 assertEquals(newComposingStart,
delta.getNewComposingStart());
54 assertEquals(newComposingEnd,
delta.getNewComposingEnd());
55 }