root/lang/perl/Text-MeCab/trunk/t/01-sanity.t @ 4114

Revision 4114, 0.8 kB (checked in by daisuke, 7 years ago)

lang/perl/Text-MeCab?; import Text-MeCab? from my repository

Line 
1#!perl
2use strict;
3use Test::More qw(no_plan);;
4
5BEGIN
6{
7    use_ok("Text::MeCab", ':all');
8}
9
10if (&Text::MeCab::MECAB_VERSION >= 0.90) {
11    ok(eval { my $v = MECAB_NOR_NODE; 1 } && !$@, "MECAB_NOR_NODE ok");
12    ok(eval { my $v = MECAB_UNK_NODE; 1 } && !$@, "MECAB_UNK_NODE ok");
13    ok(eval { my $v = MECAB_BOS_NODE; 1 } && !$@, "MECAB_BOS_NODE ok");
14    ok(eval { my $v = MECAB_EOS_NODE; 1 } && !$@, "MECAB_EOS_NODE ok");
15}
16
17# Make sure that what Text::MeCab::Node can, Text::MeCab::Node::Cloned
18# also can do.
19my @methods = (
20    qw(id surface feature length prev next stat cost),
21    qw(rlength rcattr lcattr posid char_type isbest alpha beta prob wcost)
22);
23foreach my $method (@methods) {
24    # test one by one to make it easier to read
25    can_ok("Text::MeCab::Node", $method);
26    can_ok("Text::MeCab::Node::Cloned", $method);
27}
28
291;
Note: See TracBrowser for help on using the browser.