@@ 94-104 (lines=11) @@ | ||
91 | * |
|
92 | * @return void |
|
93 | */ |
|
94 | public function testIdenticalTwo() { |
|
95 | $algorithm = new MyersDiff; |
|
96 | $x = array('a', 'b'); |
|
97 | $y = array('a', 'b'); |
|
98 | $diff = array( |
|
99 | array('a', MyersDiff::KEEP), |
|
100 | array('b', MyersDiff::KEEP), |
|
101 | ); |
|
102 | ||
103 | $this->assertSame($diff, $algorithm->calculate($x, $y)); |
|
104 | } |
|
105 | ||
106 | /** |
|
107 | * Test identical sequences containing three tokens. |
|
@@ 129-139 (lines=11) @@ | ||
126 | * |
|
127 | * @return void |
|
128 | */ |
|
129 | public function testSingleDifferentONe() { |
|
130 | $algorithm = new MyersDiff; |
|
131 | $x = array('a'); |
|
132 | $y = array('x'); |
|
133 | $diff = array( |
|
134 | array('a', MyersDiff::DELETE), |
|
135 | array('x', MyersDiff::INSERT), |
|
136 | ); |
|
137 | ||
138 | $this->assertSame($diff, $algorithm->calculate($x, $y)); |
|
139 | } |
|
140 | ||
141 | /** |
|
142 | * Test different strings containing two token. |