assertRegExp(
            '/Foo bar<\/span> Foo/',
            html_hilight($html,'bar')
        );
    }
    function testHighlightTwoWords() {
        $html = 'Foo bar Foo php Foo';
        $this->assertRegExp(
            '/Foo bar<\/span> Foo php<\/span> Foo/',
            html_hilight($html,array('bar','php'))
        );
    }
    function testHighlightTwoWordsHtml() {
        $html = 'Foo bar Foo php Foo';
        $this->assertRegExp(
            '/Foo bar<\/span><\/b> Foo<\/i> php<\/span> Foo/',
            html_hilight($html,array('bar','php'))
        );
    }
    function testNoMatchHtml() {
        $html = 'Foo font Bar';
        $this->assertRegExp(
            '/Foo font<\/span><\/font> Bar/',
            html_hilight($html,'font')
        );
    }
    function testWildcardRight() {
        $html = 'foo bar foobar barfoo foobarfoo foo';
        $this->assertRegExp(
            '/foo bar<\/span> foobar bar<\/span>foo foobarfoo foo/',
            html_hilight($html,'bar*')
        );
    }
    function testWildcardLeft() {
        $html = 'foo bar foobar barfoo foobarfoo foo';
        $this->assertRegExp(
            '/foo bar<\/span> foobar<\/span> barfoo foobarfoo foo/',
            html_hilight($html,'*bar')
        );
    }
    function testWildcardBoth() {
        $html = 'foo bar foobar barfoo foobarfoo foo';
        $this->assertRegExp(
            '/foo bar<\/span> foobar<\/span> bar<\/span>foo foobar<\/span>foo foo/',
            html_hilight($html,'*bar*')
        );
    }
    function testNoHighlight() {
        $html = 'Foo bar Foo';
        $this->assertRegExp(
            '/Foo bar Foo/',
            html_hilight($html,'php')
        );
    }
    function testMatchAttribute() {
        $html = 'Foo bar Foo';
        $this->assertRegExp(
            '/Foo bar<\/b> Foo/',
            html_hilight($html,'class="x"')
        );
    }
    function testMatchAttributeWord() {
        $html = 'Foo bar Foo';
        $this->assertEquals(
            'Foo bar Foo',
            html_hilight($html,'class="x">bar')
        );
    }
    function testRegexInjection() {
        $html = 'Foo bar Foo';
        $this->assertRegExp(
            '/Foo bar Foo/',
            html_hilight($html,'*')
        );
    }
    function testRegexInjectionSlash() {
        $html = 'Foo bar Foo';
        $this->assertRegExp(
            '/Foo bar Foo/',
            html_hilight($html,'x/')
        );
    }
    function testMB() {
        $html = 'foo ДокуВики bar';
        $this->assertRegExp(
            '/foo ДокуВики<\/span> bar/',
            html_hilight($html,'ДокуВики')
        );
    }
    function testMBright() {
        $html = 'foo ДокуВики bar';
        $this->assertRegExp(
            '/foo Доку<\/span>Вики bar/',
            html_hilight($html,'Доку*')
        );
    }
    function testMBleft() {
        $html = 'foo ДокуВики bar';
        $this->assertRegExp(
            '/foo ДокуВики<\/span> bar/',
            html_hilight($html,'*Вики')
        );
    }
    function testMBboth() {
        $html = 'foo ДокуВики bar';
        $this->assertRegExp(
            '/foo ДокуВи<\/span>ки bar/',
            html_hilight($html,'*куВи*')
        );
    }
}