Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/prose/__tests__/PhutilProseDiffTestCase.php
| Show All 24 Lines | $this->assertProseParts( | ||||
| "xxx\nyyy", | "xxx\nyyy", | ||||
| array( | array( | ||||
| "= xxx\n", | "= xxx\n", | ||||
| "- zzz\n", | "- zzz\n", | ||||
| '= yyy', | '= yyy', | ||||
| ), | ), | ||||
| pht('Remove Paragraph')); | pht('Remove Paragraph')); | ||||
| $this->assertProseParts( | |||||
| 'xxx', | |||||
| "xxxyyy\n.zzz", | |||||
| array( | |||||
| '= xxx', | |||||
| "+ yyy\n.zzz", | |||||
| ), | |||||
| pht('Amend paragraph, and add paragraph starting with punctuation')); | |||||
| // Without smoothing, the alogorithm identifies that "shark" and "cat" | // Without smoothing, the alogorithm identifies that "shark" and "cat" | ||||
| // both contain the letter "a" and tries to express this as a very | // both contain the letter "a" and tries to express this as a very | ||||
| // fine-grained edit which replaces "sh" with "c" and then "rk" with "t". | // fine-grained edit which replaces "sh" with "c" and then "rk" with "t". | ||||
| // This is technically correct, but it is much easier for human viewers to | // This is technically correct, but it is much easier for human viewers to | ||||
| // parse if we smooth this into a single removal and a single addition. | // parse if we smooth this into a single removal and a single addition. | ||||
| $this->assertProseParts( | $this->assertProseParts( | ||||
| ▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines | |||||