Ejemplo n.º 1
0
 public function testAddPadding()
 {
     // Both edges full.
     $patches = $this->p->make("", "test");
     $this->assertEquals("@@ -0,0 +1,4 @@\n+test\n", $this->p->toText($patches));
     $this->p->addPadding($patches);
     $this->assertEquals("@@ -1,8 +1,12 @@\n %01%02%03%04\n+test\n %01%02%03%04\n", $this->p->toText($patches));
     // Both edges partial.
     $patches = $this->p->make("XY", "XtestY");
     $this->assertEquals("@@ -1,2 +1,6 @@\n X\n+test\n Y\n", $this->p->toText($patches));
     $this->p->addPadding($patches);
     $this->assertEquals("@@ -2,8 +2,12 @@\n %02%03%04X\n+test\n Y%01%02%03\n", $this->p->toText($patches));
     // Both edges none.
     $patches = $this->p->make("XXXXYYYY", "XXXXtestYYYY");
     $this->assertEquals("@@ -1,8 +1,12 @@\n XXXX\n+test\n YYYY\n", $this->p->toText($patches));
     $this->p->addPadding($patches);
     $this->assertEquals("@@ -5,8 +5,12 @@\n XXXX\n+test\n YYYY\n", $this->p->toText($patches));
 }