add .coverage to git ignore

This commit is contained in:
Arkadiusz Kondas 2016-07-24 13:42:50 +02:00
parent 6ed4761427
commit 2a76cbb402
2 changed files with 21 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/vendor/
humbuglog.*
/bin/phpunit
.coverage

View File

@ -79,4 +79,24 @@ class NormalizerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($normalized, $samples, '', $delta = 0.01);
}
public function testL1NormWithZeroSumCondition()
{
$samples = [
[0, 0, 0],
[2, 0, 0],
[0, 1, -1],
];
$normalized = [
[0.33, 0.33, 0.33],
[1.0, 0.0, 0.0],
[0.0, 0.5, -0.5],
];
$normalizer = new Normalizer(Normalizer::NORM_L1);
$normalizer->transform($samples);
$this->assertEquals($normalized, $samples, '', $delta = 0.01);
}
}