Skip to content

Commit

Permalink
Add failing xor test, see extension issue #53
Browse files Browse the repository at this point in the history
  • Loading branch information
rtheunissen committed Aug 31, 2016
1 parent 29b3d26 commit 59193bb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Set/xor_.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ public function testXorWithSelf(array $a, array $b, array $expected)
$this->assertEquals([], $a->xor($a)->toArray());
}

/**
* @see https://github.com/php-ds/extension/issues/53
*/
public function testXorAfterDiff()
{
$a = $this->getInstance(['guest', 'member']);
$b = $this->getInstance(['member', 'nothing']);

$k = $a->diff($b); // [guest]
$x = $a->xor($k); // [guest, member] ^ [guest] = [member]

$this->assertToArray(['member'], $x);
}

// /**
// * @dataProvider xorDataProvider
// */
Expand Down

0 comments on commit 59193bb

Please sign in to comment.