public function testMain()
{
// Full match.
// Shortcut matches.
$this->assertEquals(0, $this->m->main("abcdef", "abcdef", 1000));
$this->assertEquals(-1, $this->m->main("", "abcdef", 1));
$this->assertEquals(3, $this->m->main("abcdef", "", 3));
$this->assertEquals(3, $this->m->main("abcdef", "de", 3));
$this->assertEquals(3, $this->m->main("abcdef", "defy", 4));
$this->assertEquals(0, $this->m->main("abcdef", "abcdefy", 0));
// Complex match.
$this->m->setThreshold(0.7);
$this->assertEquals(4, $this->m->main("I am the very model of a modern major general.", " that berry ", 5));
$this->m->setThreshold(0.5);
// Test null inputs.
try {
$this->m->main(null, null, 0);
$this->fail();
} catch (\InvalidArgumentException $e) {
}
}