Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
b''
b'\'
b'
'
b'spam'
b'\x0ff'
b'\"a'
b'\na'
b'\ra'
b'\ta'
b'\\a'
b'\'a'
b'\0a'
b'\u{0}x'
b'\u{1F63b}}'
b'\v'
b'\💩'
b'\●'
b'\\\r'
b'\x'
b'\x0'
b'\xf'
b'\xa'
b'\xx'
b'\xы'
b'\x🦀'
b'\xtt'
b'\u'
b'\u[0123]'
b'\u{0x}'
b'\u{'
b'\u{0000'
b'\u{}'
b'\u{_0000}'
b'\u{0000000}'
b'\u{FFFFFF}'
b'\u{ffffff}'
b'\u{ffffff}'
b'\u{DC00}'
b'\u{DDDD}'
b'\u{DFFF}'
b'\u{D800}'
b'\u{DAAA}'
b'\u{DBFF}'
erts and replacements are the same thing. similar::DiffTag::Insert | similar::DiffTag::Replace => { // This is the text from the `new` rope that should be // inserted into `old`. let text: &str = { let start = new.char_to_byte(new_range.start); let end = new.char_to_byte(new_range.end); &new_converted[start..end] }; Some((old_pos, pos, Some(text.into()))) } similar::DiffTag::Delete => Some((old_pos, pos, None)), similar::DiffTag::Equal => None, } }), ) } #[cfg(test)] mod tests { use super::*; quickcheck::quickcheck! { fn test_compare_ropes(a: String, b: String) -> bool { let mut old = Rope::from(a); let new = Rope::from(b); compare_ropes(&old, &new).apply(&mut old); old == new } } }