Alt-CWB-ambs
view release on metacpan or search on metacpan
t/44_ceql_bncweb.t view on Meta::CPAN
# -*- mode: cperl; buffer-file-coding-system: latin-1-unix; -*-
## Test the BNCweb extension of the CEQL grammar
## !! This file must be stored in ISO-8859-1 (Latin-1) encoding !!
use warnings;
use strict;
use Test::More tests => 180;
use Time::HiRes qw(time);
our $CEQL = new BNCweb::CEQL;
isa_ok($CEQL, "BNCweb::CEQL"); # T1
## tests for error conditions (format: <query>, <test regexp>, blank line)
our $ErrorTests = << 'STOP';
,
/alternatives separator.*within brackets/
(
/bracketing.*not balanced.*too many opening/
show[,]
/empty list.*alternatives/
{kick/V} <<s>> (the (_{A})* bucket)
/expected distance operator/
STOP
## BNCweb CEQL query tests (format: <query>, <expected CQP code>, blank line)
our $QueryTests = << 'STOP';
loveliest
[word="loveliest"%c]
birds of a feather
[word="birds"%c] [word="of"%c] [word="a"%c] [word="feather"%c]
?
[word="."%c]
\,
[word=","%c]
\?
[word="\?"%c]
will \, wo n't he \?
[word="will"%c] [word=","%c] [word="wo"%c] [word="n't"%c] [word="he"%c] [word="\?"%c]
I said to him \, " What 's up \, Sam \? "
[word="I"%c] [word="said"%c] [word="to"%c] [word="him"%c] [word=","%c] [word="&(lsquo|rsquo);"%c] [word="What"%c] [word="'s"%c] [word="up"%c] [word=","%c] [word="Sam"%c] [word="\?"%c] [word="&(lsquo|rsquo);"%c]
bath
[word="bath"%c]
Bath
[word="Bath"%c]
BATH
[word="BATH"%c]
Bath:C
( run in 1.229 second using v1.01-cache-2.11-cpan-d7f47b0818f )